/* ==========================================================================
   SMART CSC Print — Design tokens
   Palette: deep indigo (trust/authority, echoes gov.in service portals) +
   a single warm marigold accent (matches Himanshu's existing bestvletools
   navy/marigold brand) + paper-white surfaces. Typography: a sturdy grotesque
   for UI chrome, tabular numerals for prices/page-counts so the price box
   never "jitters" as digits change.
   ========================================================================== */

:root {
    --ink-900: #0f1a3d;
    --ink-700: #1e2a5c;
    --ink-500: #3d4a7a;
    --indigo-600: #1e3a8a;
    --indigo-700: #16296b;
    --marigold-500: #f0a500;
    --marigold-600: #d68f00;
    --paper-0: #ffffff;
    --paper-50: #f7f8fc;
    --paper-100: #eef0f8;
    --saffron-50: #fff8ec;
    --saffron-100: #fdeecb;
    --line: #dde1ef;
    --success: #16803c;
    --success-bg: #e9f7ef;
    --error: #c22b2b;
    --error-bg: #fdecec;
    --info-bg: #eef4ff;

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Manrope', var(--font-ui);
    --radius: 10px;
    --shadow-card: 0 1px 3px rgba(15, 26, 61, 0.06), 0 8px 24px rgba(15, 26, 61, 0.05);
    --shadow-lift: 0 10px 30px rgba(15, 26, 61, 0.12);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@700;800&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-ui);
    background: var(--paper-50);
    color: var(--ink-900);
    font-feature-settings: 'tnum' 1; /* tabular numerals for price stability */
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--ink-500); }
.small { font-size: 0.82rem; }

/* ---- Header ---- */
.site-header {
    background: linear-gradient(135deg, var(--indigo-700), var(--ink-900));
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 2px 16px rgba(15, 26, 61, 0.18);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Manrope', var(--font-ui); }
.brand-mark { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: rgba(240, 165, 0, 0.18); border: 1px solid rgba(240, 165, 0, 0.4); border-radius: 9px; flex-shrink: 0; color: var(--marigold-500); }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.1rem; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.68rem; color: rgba(255,255,255,0.65); font-weight: 600; letter-spacing: 0.02em; }
.header-tagline { font-size: 0.8rem; color: var(--marigold-500); font-weight: 600; letter-spacing: 0.03em; }

/* ---- Icon system ----
   Every icon in the app is an inline SVG <use> reference into the sprite
   defined at the top of <body> — this replaced emoji glyphs, which render
   as empty boxes on hosts/OSes missing full emoji font coverage. currentColor
   means each icon just inherits whatever text color its container sets. */
.icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -4px;
}
.icon-sm { width: 15px; height: 15px; vertical-align: -2px; }
.icon-lg { width: 34px; height: 34px; }

/* ---- Step tracker (signature element) ---- */
.step-tracker {
    display: flex;
    list-style: none;
    margin: 24px 0;
    padding: 0;
    counter-reset: none;
}
.step-tracker .step {
    flex: 1;
    text-align: center;
    padding: 10px 4px 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-500);
    position: relative;
    border-top: 3px solid var(--line);
}
.step-tracker .step.active { color: var(--indigo-700); border-top-color: var(--marigold-500); }
.step-tracker .step.done { color: var(--success); border-top-color: var(--success); }
.step-num {
    display: block;
    width: 22px; height: 22px;
    line-height: 22px;
    border-radius: 50%;
    background: var(--paper-0);
    border: 2px solid var(--line);
    margin: -14px auto 6px;
    font-size: 0.72rem;
}
.step.active .step-num { border-color: var(--marigold-500); color: var(--marigold-600); background: #fff; }
.step.done .step-num { border-color: var(--success); background: var(--success); color: #fff; }

/* ---- Cards ---- */
.card {
    background: var(--paper-0);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    padding: 28px;
    margin-bottom: 24px;
}
.card h2 {
    font-family: 'Manrope', var(--font-ui);
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 20px;
    color: var(--ink-900);
}

/* ---- Dropzone ---- */
.dropzone {
    border: 2px dashed #b9c1de;
    border-radius: var(--radius);
    background: var(--paper-50);
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--marigold-500); background: #fffaf0; }
.dropzone-icon { margin-bottom: 6px; color: var(--indigo-600); }
.dropzone-icon .icon { color: inherit; }
.dropzone p { margin: 4px 0; }

/* ---- Buttons ---- */
.btn {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 10px 18px;
    border: none;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--marigold-500); color: var(--ink-900); }
.btn-primary:hover { background: var(--marigold-600); }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink-700); }
.btn-outline:hover { border-color: var(--indigo-600); color: var(--indigo-600); }
.btn-danger { background: transparent; color: var(--error); border: 1.5px solid #f2c6c6; }
.btn-danger:hover { background: var(--error-bg); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Progress ---- */
.progress-wrap { margin-top: 16px; }
.progress-bar { height: 8px; background: var(--paper-100); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--marigold-500), var(--marigold-600)); transition: width 0.2s; }
.progress-wrap .progress-label, #progressLabel { margin: 8px 0 0; }

/* ---- File info ---- */
.file-info { margin-top: 16px; background: var(--paper-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.file-info-row { display: flex; align-items: center; gap: 12px; }
.file-icon { font-size: 1.6rem; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 8px; }

/* ---- Alerts ---- */
.alert { border-radius: 8px; padding: 12px 14px; font-size: 0.87rem; margin-top: 14px; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid #f2c6c6; }
.alert-info { background: var(--info-bg); color: var(--indigo-700); border: 1px solid #c9d8fb; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b9e6c9; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-700); margin-bottom: 6px; }
.input, .select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: var(--font-ui);
    background: #fff;
    color: var(--ink-900);
}
.input:focus, .select:focus { outline: none; border-color: var(--indigo-600); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }

.radio-pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.radio-pill span {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 99px;
    border: 1.5px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-700);
    background: #fff;
    transition: all 0.12s;
}
.radio-pill input:checked + span { background: var(--indigo-700); border-color: var(--indigo-700); color: #fff; }
.radio-pill input:focus-visible + span { outline: 2px solid var(--marigold-500); outline-offset: 2px; }

/* ---- Price box ---- */
.price-box { background: var(--paper-50); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.price-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 4px 0; color: var(--ink-700); }
.price-total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink-900); }

/* ---- Status timeline ---- */
.status-timeline { list-style: none; margin: 20px 0; padding: 0; position: relative; }
.ts-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; position: relative; font-weight: 600; color: var(--ink-500); }
.ts-item::before {
    content: '';
    position: absolute;
    left: 9px; top: 34px; bottom: -10px;
    width: 2px;
    background: var(--line);
}
.ts-item:last-child::before { display: none; }
.ts-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2.5px solid var(--line);
    background: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.ts-item.done { color: var(--success); }
.ts-item.done .ts-dot { background: var(--success); border-color: var(--success); }
.ts-item.done::before { background: var(--success); }
.ts-item.active { color: var(--marigold-600); }
.ts-item.active .ts-dot { border-color: var(--marigold-500); box-shadow: 0 0 0 4px rgba(240,165,0,0.15); animation: pulse-dot 1.4s ease-in-out infinite; }
.ts-item.failed { color: var(--error); }
.ts-item.failed .ts-dot { background: var(--error); border-color: var(--error); }
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 4px rgba(240,165,0,0.15); } 50% { box-shadow: 0 0 0 8px rgba(240,165,0,0.06); } }

/* ---- Footer ---- */
.site-footer {
    background: linear-gradient(180deg, var(--paper-50), var(--paper-100));
    border-top: 1px solid var(--line);
    padding: 40px 0 26px;
    margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--font-display); }
.footer-brand .brand-mark { background: rgba(30, 58, 138, 0.08); border-color: rgba(30, 58, 138, 0.18); color: var(--indigo-700); }
.footer-brand-name { font-weight: 800; color: var(--ink-900); font-size: 1rem; }
.footer-col h5 { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: var(--ink-700); text-decoration: none; font-size: 0.87rem; transition: color 0.12s; }
.footer-col a:hover { color: var(--marigold-600); }
.footer-contact-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.87rem; color: var(--ink-700); margin-bottom: 9px; }
.footer-contact-row .fc-icon { flex-shrink: 0; display: flex; align-items: center; height: 21px; }
.footer-contact-row .fc-icon .icon { width: 16px; height: 16px; color: var(--marigold-600); }
.footer-bottom {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Homepage marketing sections — Hero, Services, About, FAQ
   ========================================================================== */

/* Scroll-reveal utility: JS toggles .in-view once each section crosses the
   viewport. Kept as a pure opacity/transform pair (cheap, GPU-friendly) and
   fully neutralised under reduced-motion via the existing global rule. */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-1.in-view { transition-delay: 0.05s; }
.reveal-2.in-view { transition-delay: 0.15s; }
.reveal-3.in-view { transition-delay: 0.25s; }
.reveal-4.in-view { transition-delay: 0.35s; }

/* ---- Hero ---- */
.hero {
    position: relative;
    background: linear-gradient(160deg, var(--indigo-700) 0%, var(--ink-900) 65%);
    color: #fff;
    overflow: hidden;
    padding: 52px 0 64px;
}
.hero::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 340px;
    background:
        radial-gradient(480px 220px at 15% 20%, rgba(240,165,0,0.22), transparent 70%),
        radial-gradient(420px 240px at 85% 10%, rgba(99,132,255,0.20), transparent 70%);
    pointer-events: none;
}
/* Faint drifting dot grid — evokes a service-counter noticeboard without
   being a literal image; motion is slow and ambient, never distracting. */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.10) 1.4px, transparent 1.4px);
    background-size: 26px 26px;
    animation: hero-drift 26s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}
@keyframes hero-drift {
    0% { background-position: 0 0; }
    100% { background-position: 130px 130px; }
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(240, 165, 0, 0.15);
    border: 1px solid rgba(240, 165, 0, 0.4);
    color: var(--marigold-500);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 6px 14px;
    border-radius: 99px;
    margin-bottom: 18px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--marigold-500); animation: dot-pulse 1.6s ease-in-out infinite; }
@keyframes dot-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }
.hero h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.65rem, 5.5vw, 2.5rem);
    line-height: 1.2;
    margin: 0 0 14px;
}
.hero h1 span { color: var(--marigold-500); }
.hero-sub { font-size: 0.98rem; color: rgba(255,255,255,0.78); max-width: 460px; margin: 0 auto 26px; line-height: 1.55; }
.hero-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.hero .btn-primary { box-shadow: 0 8px 22px rgba(240,165,0,0.28); }
.hero .btn-ghost {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.28);
}
.hero .btn-ghost:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.5); }

/* Signature element: a live "token counter" strip, echoing the queue-ticket
   display every real Jan Seva Kendra / CSC counter has above the desk. */
.token-strip {
    display: inline-flex;
    align-items: stretch;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(6px);
}
.token-cell { padding: 12px 20px; text-align: left; }
.token-cell + .token-cell { border-left: 1px solid rgba(255,255,255,0.14); }
.token-cell .tk-label { font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.55); font-weight: 700; margin-bottom: 3px; }
.token-cell .tk-value { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: #fff; font-feature-settings: 'tnum' 1; }
.token-cell.now .tk-value { color: var(--marigold-500); animation: token-blink 2.2s ease-in-out infinite; }
@keyframes token-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---- Services strip ---- */
.services-section { padding: 46px 0 8px; }
.section-head { text-align: center; margin-bottom: 30px; }
.section-eyebrow { font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--marigold-600); margin-bottom: 8px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.25rem, 3.5vw, 1.6rem); font-weight: 800; color: var(--ink-900); margin: 0 0 8px; }
.section-head p { color: var(--ink-500); font-size: 0.92rem; max-width: 480px; margin: 0 auto; }

.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.service-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(240,165,0,0.4); }
.service-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--info-bg);
    color: var(--indigo-600);
    margin-bottom: 14px;
    transition: transform 0.18s ease;
}
.service-card:hover .service-icon { transform: scale(1.08) rotate(-4deg); }
.service-card:nth-child(2) .service-icon { background: var(--saffron-100); color: var(--marigold-600); }
.service-card:nth-child(3) .service-icon { background: var(--success-bg); color: var(--success); }
.service-card:nth-child(4) .service-icon { background: #fdecec; color: var(--error); }
.service-card h3 { font-size: 0.95rem; font-weight: 800; color: var(--ink-900); margin: 0 0 6px; }
.service-card p { font-size: 0.82rem; color: var(--ink-500); line-height: 1.5; margin: 0; }

/* ---- About / shop section ---- */
.about-section { padding: 54px 0; }
.about-panel {
    background: linear-gradient(135deg, var(--saffron-50), #fff 60%);
    border: 1px solid var(--saffron-100);
    border-radius: 18px;
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.about-panel::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,165,0,0.14), transparent 70%);
}
.about-copy h2 { font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 800; color: var(--ink-900); margin: 0 0 12px; }
.about-copy p { color: var(--ink-700); font-size: 0.92rem; line-height: 1.65; margin: 0 0 14px; }
.about-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--line);
    padding: 7px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink-700);
}
.about-badge:nth-child(1) { color: var(--success); border-color: #b9e6c9; }
.about-badge:nth-child(2) { color: var(--indigo-600); border-color: #c9d8fb; }
.about-badge:nth-child(3) { color: var(--marigold-600); border-color: var(--saffron-100); }
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.about-stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.about-stat .stat-num { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--indigo-700); font-feature-settings: 'tnum' 1; }
.about-stat .stat-label { font-size: 0.74rem; color: var(--ink-500); font-weight: 600; margin-top: 4px; }

/* ---- FAQ ---- */
.faq-section { padding: 10px 0 54px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.faq-item.open { border-color: rgba(30,58,138,0.35); }
.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink-900);
    cursor: pointer;
}
.faq-q .faq-plus {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--info-bg);
    color: var(--indigo-700);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.faq-item.open .faq-q .faq-plus { transform: rotate(135deg); background: var(--marigold-500); color: var(--ink-900); }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s ease; }
.faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; }
.faq-a { padding: 0 18px 18px; font-size: 0.87rem; color: var(--ink-500); line-height: 1.6; }

/* ---- Homepage bottom CTA (links to the standalone print.php page) ---- */
.cta-section {
    padding: 54px 0 64px;
    background: linear-gradient(180deg, rgba(30,58,138,0.04), rgba(30,58,138,0));
    border-top: 1px solid var(--line);
}
.cta-section h2 { margin: 0 0 10px; }

@media (max-width: 760px) {
    .services-grid { grid-template-columns: 1fr 1fr; }
    .about-panel { grid-template-columns: 1fr; padding: 24px; }
}
@media (max-width: 520px) {
    .services-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: 1fr 1fr; }
    .token-strip { flex-direction: column; }
    .token-cell + .token-cell { border-left: none; border-top: 1px solid rgba(255,255,255,0.14); }
    .hero { padding: 40px 0 48px; }
}

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .form-grid { grid-template-columns: 1fr; }
    .step-tracker .step { font-size: 0.7rem; }
}

/* ---- Accessibility ---- */
:focus-visible { outline: 2px solid var(--marigold-500); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Crop Studio (Step 1.5) — perspective quad-crop for Document & ID Card modes
   ========================================================================== */

/* ---- Mode picker (shown right after upload) ---- */
/* ---- Step 0: Mode picker (A4 Document / ID Card choice) ---- */
.mode-picker { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.mode-card {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 26px 22px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s;
}
.mode-card:hover { border-color: var(--marigold-500); background: #fffaf0; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.mode-card.selected { border-color: var(--indigo-700); background: var(--info-bg); box-shadow: 0 0 0 3px rgba(30,58,138,0.1); }
.mode-card-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: var(--info-bg);
    color: var(--indigo-600);
    margin-bottom: 2px;
}
.mode-card-icon .icon { width: 24px; height: 24px; }
.mode-card-title { font-weight: 800; color: var(--ink-900); font-size: 1.05rem; }
.mode-card-desc { font-size: 0.86rem; color: var(--ink-500); line-height: 1.55; }

/* ---- Crop studio shell ---- */
.crop-studio { display: flex; flex-direction: column; gap: 16px; }
.crop-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--paper-50);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.crop-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: #fff;
    color: var(--ink-700);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--line);
}
.crop-tool-btn:hover { border-color: var(--indigo-600); color: var(--indigo-600); }
.crop-tool-btn.accent { background: var(--info-bg); color: var(--indigo-700); border-color: #c9d8fb; }
.crop-tool-btn.enhance { background: var(--success-bg); color: var(--success); border-color: #b9e6c9; }

/* Thumbnails strip (multi-page document mode) */
.crop-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.crop-thumb {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    background: var(--paper-100);
}
.crop-thumb.active { border-color: var(--indigo-700); }
.crop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crop-thumb-add {
    flex-shrink: 0;
    width: 42px; height: 42px;
    border-radius: 6px;
    border: 1.5px dashed #b9c1de;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-500);
    cursor: pointer;
    font-size: 1.1rem;
}
.crop-thumb-add:hover { border-color: var(--marigold-500); color: var(--marigold-600); }

/* The quad-crop canvas area */
.crop-stage {
    position: relative;
    background: var(--ink-900);
    border-radius: var(--radius);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}
.crop-stage-empty { color: rgba(255,255,255,0.45); font-size: 0.85rem; text-align: center; padding: 24px; }

/* Corner handles (touch-friendly, 36px hit target) */
.corner-handle {
    width: 30px; height: 30px;
    background: var(--marigold-500);
    border: 3px solid #ffffff;
    border-radius: 50%;
    position: absolute;
    cursor: pointer;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    z-index: 50;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.corner-handle:hover, .corner-handle:active { transform: translate(-50%, -50%) scale(1.15); background: var(--marigold-600); }
.corner-handle span { font-size: 8px; font-weight: 800; color: var(--ink-900); pointer-events: none; }

/* Brightness / contrast sliders row */
.crop-sliders { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 4px 0; }
.crop-slider { flex: 1 1 140px; display: flex; align-items: center; gap: 10px; }
.crop-slider span { font-size: 0.75rem; color: var(--ink-500); font-weight: 600; width: 64px; flex-shrink: 0; }
.crop-slider input[type=range] { width: 100%; accent-color: var(--marigold-500); }

/* ID card dual editor cards (front / back) */
.id-side-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.id-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--info-bg);
    border-bottom: 1px solid #c9d8fb;
}
.id-side-head.is-back { background: var(--paper-50); border-bottom-color: var(--line); }
.id-side-head h4 { margin: 0; font-size: 0.82rem; font-weight: 800; color: var(--indigo-700); }
.id-side-head.is-back h4 { color: var(--ink-700); }
.id-side-head .btn { padding: 5px 10px; font-size: 0.72rem; }

/* Live A4 preview */
.crop-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.crop-preview-label { align-self: flex-start; font-size: 0.72rem; font-weight: 800; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; }
.a4-preview-box {
    background: #fff;
    box-shadow: var(--shadow-card);
    aspect-ratio: 210 / 297;
    width: 100%;
    max-width: 220px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
}
.a4-preview-box.landscape { aspect-ratio: 297 / 210; max-width: 300px; }
.a4-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.a4-scaler { width: 210mm; height: 297mm; transform-origin: top left; position: absolute; top: 0; left: 0; }

/* Crop settings row (orientation / fit / card size etc.) */
.crop-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.crop-settings-grid .form-group-full { grid-column: 1 / -1; }

/* Sticky action bar at the bottom of the crop step */
.crop-actions { display: flex; gap: 10px; }
.crop-actions .btn { flex: 1; }

@media (max-width: 520px) {
    .crop-settings-grid { grid-template-columns: 1fr; }
    .mode-picker { flex-direction: column; }
}