/* ============================================
   Passport photo maker / photo-checker
   Page-scoped styles (pc- prefix)
   ============================================ */

.pc-body {
    background: var(--bg-light);
}

.pc-main {
    padding-bottom: 80px;
}

/* ---------- Hero ---------- */
.pc-hero {
    padding: 132px 0 84px;
    background:
        radial-gradient(900px 320px at 12% -10%, rgba(37, 99, 235, 0.16), transparent 70%),
        radial-gradient(700px 280px at 95% 0%, rgba(6, 182, 212, 0.12), transparent 70%),
        linear-gradient(180deg, var(--primary-50) 0%, var(--bg-light) 100%);
    border-bottom: 1px solid var(--border-light);
}

.pc-hero h1 {
    font-size: clamp(26px, 4.4vw, 42px);
    line-height: 1.14;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin: 0 0 16px;
    max-width: 820px;
}

.pc-lead {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 0 26px;
}

.pc-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.pc-facts li {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 16px;
    line-height: 1.35;
}

.pc-facts strong {
    display: block;
    font-size: 15px;
    color: var(--text-dark);
}

.pc-facts span {
    font-size: 12.5px;
    color: var(--text-muted);
}

.pc-legal-line {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ---------- Wizard shell ---------- */
.pc-wizard {
    margin-top: -36px;
    position: relative;
    z-index: 2;
    scroll-margin-top: 92px;
}

.pc-steps {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
}

.pc-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    backdrop-filter: blur(8px);
}

.pc-steps li.is-done {
    color: var(--text-dark);
}

.pc-steps li.is-active {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.45);
    color: var(--primary);
    box-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.35);
}

.pc-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: var(--border-light);
    color: var(--text-muted);
    flex: 0 0 auto;
}

.pc-steps li.is-done .pc-step-num {
    background: var(--accent-green);
    color: #fff;
}

.pc-steps li.is-active .pc-step-num {
    background: var(--primary);
    color: #fff;
}

.pc-panel,
.pc-editor-step {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.pc-panel {
    padding: 26px;
}

.pc-step[hidden] {
    display: none;
}

.pc-panel-head {
    margin-bottom: 20px;
}

.pc-panel-head h2 {
    font-size: 21px;
    color: var(--text-dark);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.pc-panel-head p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    max-width: 620px;
}

.pc-hint {
    font-size: 12.5px;
    color: var(--text-light);
    margin: 14px 0 0;
}

/* ---------- Step 1: size cards ---------- */
.pc-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pc-spec {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    padding: 16px 16px 14px;
    min-height: 128px;
    background: var(--bg-light);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font: inherit;
    color: var(--text-body);
    cursor: pointer;
    transition: var(--transition);
}

.pc-spec:hover {
    border-color: var(--primary-light);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pc-spec:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.pc-spec[aria-pressed="true"] {
    border-color: var(--primary);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pc-spec-country {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    border-radius: 999px;
    padding: 2px 8px;
    margin-bottom: 6px;
}

.pc-spec-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.pc-spec-size {
    font-size: 13.5px;
    color: var(--text-body);
    margin-top: 4px;
}

.pc-spec-size small {
    display: block;
    font-size: 11.5px;
    color: var(--text-light);
}

.pc-spec-px {
    margin-top: auto;
    padding-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Step 2: upload ---------- */
.pc-back {
    background: none;
    border: 0;
    padding: 4px 0;
    margin-bottom: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.pc-back:hover {
    color: var(--primary);
}

.pc-dropzone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    background: var(--bg-light);
    padding: 38px 22px 30px;
    text-align: center;
    transition: var(--transition);
}

.pc-dropzone.is-over {
    border-color: var(--primary);
    background: var(--primary-50);
}

.pc-drop-icon {
    color: var(--primary-light);
    margin: 0 auto 10px;
}

.pc-drop-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 16px;
}

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

.pc-upload-actions .btn {
    min-height: 48px;
    padding: 12px 26px;
}

.pc-drop-note {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 16px 0 0;
}

.pc-error {
    margin: 14px 0 0;
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    color: #B91C1C;
    font-size: 13.5px;
}

.pc-upload-tips {
    margin: 20px 0 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.9;
}

/* ---------- Step 3: editor ---------- */
.pc-editor-step {
    padding: 14px;
}

.pc-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 344px;
    gap: 14px;
    align-items: start;
}

.pc-editor-stage {
    min-width: 0;
}

.pc-stage {
    position: relative;
    height: clamp(340px, 62vh, 620px);
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 12%, #1d2b45 0%, #0b1220 72%);
}

#stageCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: grab;
    outline: none;
}

#stageCanvas:active {
    cursor: grabbing;
}

#stageCanvas:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(59, 130, 246, 0.7);
}

.pc-busy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(11, 18, 32, 0.82);
    backdrop-filter: blur(3px);
    color: #e6edf7;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    z-index: 2;
}

.pc-busy[hidden] {
    display: none;
}

.pc-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.22);
    border-top-color: #60a5fa;
    animation: pc-spin 0.9s linear infinite;
}

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

.pc-progress {
    width: min(240px, 70%);
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.pc-progress i {
    display: block;
    width: 38%;
    height: 100%;
    border-radius: inherit;
    background: #60a5fa;
    animation: pc-slide 1.25s ease-in-out infinite;
}

@keyframes pc-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(310%); }
}

.pc-stage-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 14px;
    padding: 9px 4px 2px;
}

.pc-status {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.pc-status.is-error {
    color: #B45309;
}

.pc-stage-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
}

.pc-editor-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}

.pc-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pc-side-head h2 {
    font-size: 16px;
    color: var(--text-dark);
    margin: 0;
}

.pc-spec-badge {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-50);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
}

.pc-control-group h3,
.pc-checks-wrap h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.pc-control-group {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.pc-swatches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.pc-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 58px;
    padding: 7px 4px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-body);
    cursor: pointer;
    transition: var(--transition);
}

.pc-swatch:hover {
    border-color: var(--primary-light);
}

.pc-swatch[aria-pressed="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

.pc-swatch:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pc-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    display: block;
}

.pc-swatches.is-disabled .pc-dot {
    filter: grayscale(1);
}

/* Custom background colour */.pc-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pc-custom-row input[type="color"] {
    width: 46px;
    height: 40px;
    padding: 2px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    background: #fff;
    cursor: pointer;
}

.pc-custom-row input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text);
    background: #fff;
}

.pc-custom-row input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}

/* 4×6 sheet preview */
.pc-sheet-preview {
    margin: 14px 0 0;
    text-align: center;
}

.pc-sheet-preview canvas {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(8, 14, 26, 0.16);
    background: #fff;
}

.pc-sheet-preview figcaption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

.pc-zoom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.pc-zoom-live {
    float: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.pc-reset {
    background: none;
    border: 0;
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 6px;
}

.pc-reset:hover {
    background: var(--primary-50);
}

#zoomRange {
    width: 100%;
    height: 34px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.pc-checks-wrap {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.pc-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-checks li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-body);
}

.pc-checks li::before {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    background: #E7F6EE;
    color: #0E7A45;
    content: "✓";
}

.pc-checks li.is-warn::before {
    content: "!";
    background: #FEF3C7;
    color: #B45309;
}

.pc-checks li.is-info::before {
    content: "i";
    background: var(--primary-50);
    color: var(--primary);
    font-style: italic;
}

.pc-exports {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.pc-exports .btn {
    min-height: 48px;
}

.pc-link-btn {
    background: none;
    border: 0;
    padding: 6px 0;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-align: center;
    min-height: 32px;
}

.pc-link-btn:hover {
    text-decoration: underline;
}

.pc-file-note,
.pc-sheet-note {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-muted);
    min-height: 0;
}

.pc-sheet-note[hidden] {
    display: none;
}

.pc-back-side {
    margin: 0;
    align-self: flex-start;
}

/* ---------- Info section ---------- */
.pc-info {
    max-width: 1000px;
    margin-top: 56px;
}

.pc-info h2 {
    font-size: 24px;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}

.pc-info h2 + p {
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 820px;
}

.pc-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 18px 0 42px;
}

.pc-info-grid h3 {
    font-size: 15px;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.pc-info-grid p {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .pc-editor {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .pc-spec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    /* Full-screen, app-like editor on phones */
    .pc-wizard {
        margin-top: 0;
        padding: 0;
        scroll-margin-top: 72px;
    }

    .pc-steps {
        position: static;
        background: var(--bg-light);
        padding: 8px 10px;
        margin: 0;
    }

    .pc-steps li {
        padding: 8px 6px;
        font-size: 11.5px;
        gap: 6px;
        justify-content: center;
        background: #fff;
        border-radius: 8px;
    }

    .pc-step-num {
        width: 18px;
        height: 18px;
        font-size: 10.5px;
    }

    .pc-panel {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 20px 16px;
    }

    .pc-editor-step {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 10px;
        min-height: calc(100dvh - 56px);
    }

    .pc-editor {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .pc-stage {
        height: min(56dvh, 460px);
        min-height: 300px;
        border-radius: 12px;
    }

    .pc-editor-side {
        gap: 12px;
        padding: 14px;
    }

    .pc-swatches {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pc-exports .btn {
        min-height: 50px;
    }

    .pc-info-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

@media (max-width: 640px) {
    .pc-hero {
        padding: 108px 0 62px;
    }

    .pc-hero .container {
        padding: 0 16px;
    }

    .pc-lead {
        font-size: 15.5px;
    }

    .pc-facts {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .pc-facts li {
        padding: 8px 12px;
    }

    .pc-spec-grid {
        gap: 8px;
    }

    .pc-spec {
        min-height: 118px;
        padding: 12px;
        border-radius: 12px;
    }

    .pc-spec-name {
        font-size: 14px;
    }

    .pc-spec-size {
        font-size: 12.5px;
    }

    .pc-dropzone {
        padding: 28px 14px 24px;
    }

    .pc-upload-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pc-upload-actions .btn {
        width: 100%;
    }

    .pc-stage-meta {
        padding-bottom: 0;
    }

    .pc-stage-hint {
        font-size: 11.5px;
    }

    .pc-info {
        padding: 0 16px;
        margin-top: 40px;
    }

    .pc-info h2 {
        font-size: 21px;
    }
}
