/**
 * Chiba Nepal Festival 2026 - Profile Frame Tool
 * Palette: NRNA blue (#1744a0) primary + festival yellow accents.
 */

.cnf-frame-tool [hidden] {
    display: none !important;
}

.cnf-frame-tool {
    --cnf-primary: #1744a0;
    --cnf-primary-dark: #10306f;
    --cnf-primary-light: #e9effb;
    --cnf-yellow: #ffce3c;
    --cnf-cream: #fff8e7;
    --cnf-text: #2b2320;
    --cnf-muted: #7a6f66;
    --cnf-border: rgba(43, 35, 32, 0.08);
    max-width: 620px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    color: var(--cnf-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- card ---------- */

.cnf-card {
    background: #fff;
    border: 1px solid var(--cnf-border);
    border-radius: 24px;
    padding: 28px 22px 30px;
    box-shadow: 0 10px 40px rgba(43, 35, 32, 0.08);
}

/* ---------- header ---------- */

.cnf-header {
    text-align: center;
    margin-bottom: 20px;
}

.cnf-badge {
    display: inline-block;
    background: var(--cnf-yellow);
    color: var(--cnf-text);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.cnf-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--cnf-primary);
    margin: 0 0 8px;
    line-height: 1.25;
}

.cnf-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--cnf-muted);
    margin: 0;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- steps ---------- */

.cnf-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
}

.cnf-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cnf-muted);
    padding: 7px 13px;
    border-radius: 999px;
    background: #f6f2ea;
    white-space: nowrap;
}

.cnf-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd5c8;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    flex: none;
}

.cnf-step--active {
    background: var(--cnf-primary-light);
    color: var(--cnf-primary);
    box-shadow: inset 0 0 0 1.5px var(--cnf-primary);
}

.cnf-step--active span {
    background: var(--cnf-primary);
}

.cnf-step--done span {
    background: #2e9e5b;
}

/* ---------- buttons ---------- */

.cnf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.cnf-btn svg {
    width: 18px;
    height: 18px;
    flex: none;
}

.cnf-btn--primary {
    background: linear-gradient(180deg, #1d52bd 0%, var(--cnf-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(23, 68, 160, 0.35);
}

.cnf-btn--primary:hover {
    background: var(--cnf-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(23, 68, 160, 0.42);
}

.cnf-btn--ghost {
    background: #fff;
    color: var(--cnf-primary);
    border: 2px solid var(--cnf-primary);
}

.cnf-btn--ghost:hover {
    background: var(--cnf-primary-light);
}

.cnf-btn--lg {
    padding: 16px 34px;
    font-size: 1.05rem;
}

.cnf-btn--icon {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.3rem;
    background: #fff;
    color: var(--cnf-primary);
    border: 2px solid var(--cnf-primary);
    flex: none;
}

/* ---------- upload / frame preview ---------- */

.cnf-upload-area {
    text-align: center;
}

.cnf-frame-preview {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background: radial-gradient(circle at 50% 38%, #fff 0%, var(--cnf-cream) 70%);
    box-shadow: 0 8px 28px rgba(43, 35, 32, 0.16);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.cnf-frame-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(43, 35, 32, 0.22);
}

.cnf-frame-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.cnf-frame-preview-cta {
    position: absolute;
    left: 50%;
    top: 38%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 16px 22px;
    border-radius: 16px;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.cnf-frame-preview-cta svg {
    width: 30px;
    height: 30px;
}

.cnf-upload-area .cnf-btn--lg {
    margin-top: 18px;
}

.cnf-upload-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--cnf-muted);
    margin: 14px 0 0;
}

.cnf-upload-hint svg {
    width: 14px;
    height: 14px;
    flex: none;
}

/* ---------- editor ---------- */

.cnf-canvas-wrap {
    position: relative;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(43, 35, 32, 0.16);
    background: #f0ede8;
}

#cnf-canvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: grab;
}

#cnf-canvas:active {
    cursor: grabbing;
}

.cnf-drag-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cnf-drag-hint--visible {
    opacity: 1;
}

.cnf-drag-hint span {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
}

.cnf-controls {
    margin-top: 18px;
}

.cnf-zoom-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#cnf-zoom-slider {
    flex: 1;
    accent-color: var(--cnf-primary);
    height: 6px;
    cursor: pointer;
}

.cnf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* ---------- result ---------- */

.cnf-result {
    text-align: center;
}

.cnf-result-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--cnf-primary);
    margin: 0 0 14px;
}

#cnf-result-img {
    width: 100%;
    max-width: 480px;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(43, 35, 32, 0.18);
    margin-bottom: 12px;
}

.cnf-result-hint {
    font-size: 0.8rem;
    color: var(--cnf-muted);
    margin: 0 0 14px;
    line-height: 1.6;
}

/* ---------- loading ---------- */

.cnf-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cnf-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(23, 68, 160, 0.2);
    border-top-color: var(--cnf-primary);
    border-radius: 50%;
    animation: cnf-spin 0.8s linear infinite;
}

@keyframes cnf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- IT partner credit ---------- */

.cnf-partner {
    margin-top: 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cnf-partner-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cnf-muted);
}

.cnf-partner-link {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cnf-primary);
    text-decoration: none;
}

.cnf-partner-link:hover {
    color: var(--cnf-primary-dark);
    text-decoration: underline;
}

.cnf-partner-tagline {
    font-size: 0.75rem;
    color: var(--cnf-muted);
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
    .cnf-frame-tool {
        padding: 12px 10px 32px;
    }

    .cnf-card {
        padding: 22px 14px 24px;
        border-radius: 18px;
    }

    .cnf-title {
        font-size: 1.35rem;
    }

    .cnf-step {
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    .cnf-actions .cnf-btn {
        flex: 1 1 100%;
    }
}
