/* ===========================================================================
   KagziSeva — PAN Card Application portal
   Professional design system (tokens → layout → components)
   =========================================================================== */

:root {
    /* Brand */
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-darker: #1e3a8a;
    --primary-soft:   #eff4ff;
    --primary-soft-2: #dbe7ff;
    --accent:         #0ea5e9;

    /* Neutrals (cool slate ramp) */
    --ink:        #0f172a;
    --text:       #243244;
    --muted:      #64748b;
    --muted-2:    #94a3b8;
    --border:     #e6eaf1;
    --border-2:   #d4dbe6;
    --surface:    #ffffff;
    --bg:         #eef2f8;

    /* Status */
    --success:    #059669;
    --success-bg: #ecfdf5;
    --danger:     #dc2626;
    --danger-bg:  #fef2f2;
    --warning:    #d97706;

    /* Radius */
    --r-sm: 8px;
    --r:    12px;
    --r-lg: 16px;
    --r-xl: 22px;

    /* Shadows (soft, layered) */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, .06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .12);
    --ring:      0 0 0 4px rgba(37, 99, 235, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 480px at 100% -8%, rgba(37, 99, 235, .10), transparent 60%),
        radial-gradient(760px 420px at -10% 0%, rgba(14, 165, 233, .08), transparent 55%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================== Header ============================== */
.site-header {
    background: linear-gradient(100deg, #0b245e 0%, var(--primary-darker) 45%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 3px solid var(--accent);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
}
.brand { display: flex; align-items: center; }
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img { height: 46px; width: auto; display: block; }
.header-secure {
    display: flex; flex-direction: column; align-items: flex-end;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
}
.secure-title { margin: 0; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.secure-title::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .25);
}
.secure-subtitle { margin: 1px 0 0; font-size: 11px; color: rgba(255, 255, 255, .72); }

/* ============================== Page shell ============================== */
.page { padding: 0 0 60px; }
.app-container { padding-top: 40px; }

/* Page intro */
.page-intro { text-align: center; max-width: 760px; margin: 0 auto 32px; }
.page-eyebrow {
    display: inline-block;
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-2);
    padding: 6px 14px; border-radius: 999px;
}
.page-heading {
    font-size: clamp(1.9rem, 3.4vw, 2.75rem);
    font-weight: 800; letter-spacing: -0.025em;
    color: var(--ink); margin: 16px 0 0;
}
.page-sub { margin: 12px auto 0; max-width: 600px; color: var(--muted); font-size: 16px; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.trust-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow-xs);
}
.trust-chip svg { color: var(--success); }

/* ============================== Two-column layout ============================== */
.app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}
.app-main { min-width: 0; }

/* ============================== Form sections ============================== */
.form-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px 30px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}
.section-title {
    display: flex; align-items: center; gap: 14px;
    font-size: 19px; font-weight: 700; color: var(--ink);
    margin: 0 0 22px; padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.section-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex-shrink: 0;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid var(--primary-soft-2);
    border-radius: 11px;
}
.subsection-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: var(--text);
    margin: 28px 0 16px;
    text-transform: uppercase; letter-spacing: .04em;
}
.subsection-title::before {
    content: ""; width: 20px; height: 2px; border-radius: 2px;
    background: var(--primary); flex-shrink: 0;
}
.badge-soft {
    font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: none;
    color: var(--primary-dark);
    background: var(--primary-soft); border: 1px solid var(--primary-soft-2);
    padding: 3px 10px; border-radius: 999px;
}

/* ============================== Grid ============================== */
.grid { display: grid; gap: 18px 22px; margin-bottom: 4px; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-2-uneven { grid-template-columns: 1fr 1.7fr; }

/* ============================== Fields ============================== */
.form-group { display: flex; flex-direction: column; min-width: 0; }
.field-label {
    font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.field-label .req { color: var(--danger); }
.field-label .opt { color: var(--muted-2); font-weight: 500; font-size: 12px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    font-size: 14.5px; font-family: inherit;
    color: var(--ink);
    background: #fbfcfe;
    transition: border-color .15s, box-shadow .15s, background .15s;
    outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted-2); }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--muted-2); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: var(--ring);
}
.form-textarea { resize: vertical; min-height: 104px; line-height: 1.5; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px; cursor: pointer;
}
.form-select:disabled {
    background-color: #f1f5f9; color: var(--muted-2); cursor: not-allowed;
}

.field-hint {
    display: flex; align-items: center; gap: 6px;
    margin: 7px 0 0; font-size: 12.5px; color: var(--muted);
}
.field-hint svg { color: var(--muted-2); flex-shrink: 0; }
.field-error { margin: 7px 0 0; font-size: 12.5px; color: var(--danger); font-weight: 500; }

.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .form-textarea,
.file-group.has-error .upload-box {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}

/* ============================== File upload ============================== */
.file-group .form-file {
    position: absolute; width: 1px; height: 1px;
    opacity: 0; overflow: hidden; clip: rect(0 0 0 0);
}
.upload-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 8px;
    border: 1.5px dashed var(--border-2);
    border-radius: var(--r);
    padding: 26px 16px;
    cursor: pointer; background: #fafbfe;
    transition: border-color .15s, background .15s, transform .1s;
    min-height: 142px;
}
.upload-box:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.upload-box.dragover { border-color: var(--primary); background: var(--primary-soft-2); }
.upload-box.has-file { border-style: solid; border-color: var(--success); background: var(--success-bg); }
.upload-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: #eef2f8; color: var(--muted);
}
.upload-box:hover .upload-icon { background: #fff; color: var(--primary); }
.upload-box.has-file .upload-icon { background: #fff; color: var(--success); }
.upload-main { font-size: 13.5px; color: var(--text); font-weight: 600; }
.upload-formats { font-size: 12px; color: var(--muted-2); }
.upload-filename { font-size: 12.5px; color: var(--success); font-weight: 600; word-break: break-all; }

/* ============================== Declaration ============================== */
.declaration {
    display: flex; align-items: flex-start; gap: 13px;
    font-size: 14px; line-height: 1.6; color: var(--text); cursor: pointer;
    background: #fafbfe; border: 1px solid var(--border);
    border-radius: var(--r); padding: 16px 18px;
}
.declaration .form-check {
    width: 19px; height: 19px; margin: 2px 0 0;
    accent-color: var(--primary); flex-shrink: 0; cursor: pointer;
}
.declaration .req { color: var(--danger); }
.declaration.has-error { border-color: var(--danger); background: var(--danger-bg); }
.declaration.has-error span { color: var(--danger); }

/* ============================== Actions ============================== */
.form-actions {
    display: grid; grid-template-columns: 1fr 2fr; gap: 16px;
    margin: 6px 0 4px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 15px 22px;
    border-radius: var(--r-sm);
    font-size: 15px; font-weight: 700; font-family: inherit;
    cursor: pointer; border: 1px solid transparent; text-decoration: none;
    transition: transform .08s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn-reset {
    background: var(--surface); color: var(--text); border-color: var(--border-2);
}
.btn-reset:hover { background: #f8fafc; border-color: var(--muted-2); }
.btn-submit {
    color: #fff;
    background: linear-gradient(180deg, #3b82f6 0%, var(--primary) 60%, var(--primary-dark) 100%);
    box-shadow: 0 10px 22px rgba(37, 99, 235, .32);
}
.btn-submit:hover { box-shadow: 0 14px 28px rgba(37, 99, 235, .42); filter: saturate(1.05); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

/* ============================== Alerts ============================== */
.alerts { margin: 0 0 22px; }
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-radius: var(--r-sm);
    font-size: 14.5px; font-weight: 500; margin-bottom: 10px;
}
.alert-error, .alert-danger { background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: var(--success-bg); color: #047857; border: 1px solid #a7f3d0; }

/* ============================== Sidebar ============================== */
.app-aside {
    position: sticky; top: 96px;
    display: flex; flex-direction: column; gap: 18px;
}
.side-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.side-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 16px;
}
.side-title svg { color: var(--primary); flex-shrink: 0; }

/* Fee card */
.fee-card {
    background: linear-gradient(165deg, #0b245e, var(--primary-darker));
    border-color: transparent; color: #fff;
}
.fee-card .side-title { color: #fff; }
.fee-list { list-style: none; margin: 0 0 14px; padding: 0; }
.fee-list li {
    display: flex; justify-content: space-between;
    font-size: 14px; color: rgba(255, 255, 255, .82);
    padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.fee-total {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 14px;
}
.fee-total span:first-child { font-size: 14px; color: rgba(255, 255, 255, .82); }
.fee-amount { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.fee-note { margin: 12px 0 0; font-size: 12px; color: rgba(255, 255, 255, .66); line-height: 1.5; }

/* Progress */
.progress-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; color: var(--text); font-weight: 600; margin-bottom: 12px;
}
#progress-percent {
    font-weight: 800; color: var(--primary-dark);
    background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; font-size: 13px;
}
.progress-track { height: 9px; background: #e7edf6; border-radius: 999px; overflow: hidden; }
.progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 999px; transition: width .35s ease;
}
.progress-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* Info / helper lists */
.info-list { margin: 0; padding: 0; list-style: none; }
.info-list li {
    position: relative; padding-left: 22px; margin-bottom: 11px;
    color: var(--muted); font-size: 13.5px; line-height: 1.5;
}
.info-list li:last-child { margin-bottom: 0; }
.info-list li::before {
    content: ""; position: absolute; left: 4px; top: 7px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.helper-list { list-style: none; margin: 0; padding: 0; }
.helper-list li {
    display: flex; align-items: center; gap: 10px;
    color: var(--text); font-size: 13.5px; margin-bottom: 13px;
}
.helper-list li:last-child { margin-bottom: 0; }
.helper-list li svg { color: var(--primary); flex-shrink: 0; }
.helper-list strong { color: var(--ink); font-weight: 700; }

/* ============================== Centered card (success / payment) ============================== */
.application-card {
    max-width: 680px; margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 18px; box-shadow: var(--shadow-lg);
}
.success-card { text-align: center; padding: 52px 40px; }
.success-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 84px; height: 84px; border-radius: 50%;
    color: var(--success); background: var(--success-bg);
    border: 1px solid #a7f3d0; margin-bottom: 22px;
}
.hero-title { font-size: 28px; font-weight: 800; margin: 0; color: var(--ink); letter-spacing: -0.02em; }
.hero-subtitle { margin: 12px auto 0; max-width: 480px; color: var(--muted); font-size: 16px; }
.reference-box {
    display: inline-flex; flex-direction: column; gap: 6px; align-items: center;
    background: var(--primary-soft); border: 1px dashed var(--primary);
    border-radius: var(--r); padding: 18px 44px; margin: 28px 0;
}
.reference-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.reference-id { font-size: 26px; font-weight: 800; color: var(--primary-dark); letter-spacing: 0.05em; }
.success-info { display: inline-block; text-align: left; max-width: 520px; margin: 0 auto 28px; }
.success-info li { font-size: 14px; }
.success-card .form-actions { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; }
.success-card .btn-submit { width: 100%; }

/* ============================== Authorized partners ============================== */
.partners {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 56px;
    padding: 40px 0 44px;
    text-align: center;
}
.partners-eyebrow {
    margin: 0 0 24px;
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted);
}
.partners-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;
}
.partner-card {
    display: flex; align-items: center; gap: 16px;
    background: #fbfcfe;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 22px;
    min-width: 280px;
    box-shadow: var(--shadow-xs);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.partner-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft-2);
}
.partner-mark {
    display: inline-flex; align-items: baseline;
    font-weight: 800; font-size: 22px; letter-spacing: -0.01em;
    padding: 12px 16px; border-radius: var(--r-sm);
    color: #fff; flex-shrink: 0; line-height: 1;
}
.partner-mark span { font-weight: 600; font-size: 13px; opacity: .9; margin-left: 2px; }
.partner-mark-utiitsl { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.partner-mark-utiitsl span { color: #fbbf24; opacity: 1; }
.partner-mark-nsdl { background: linear-gradient(135deg, #0b245e, #1e3a8a); }
.partner-meta { display: flex; flex-direction: column; text-align: left; gap: 3px; }
.partner-meta strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.partner-meta span { font-size: 12.5px; color: var(--muted); }
.partners-note {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 26px auto 0; max-width: 620px;
    font-size: 12.5px; color: var(--muted-2); line-height: 1.5;
}
.partners-note svg { color: var(--success); flex-shrink: 0; }

/* ============================== Footer ============================== */
.site-footer { background: #0b245e; color: #fff; margin-top: 0; }
.footer-brand {
    display: flex; align-items: center;
    padding: 32px 24px 4px;
}
.footer-logo { height: 44px; width: auto; display: block; }
.footer-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px;
    padding: 28px 24px 32px;
}
.footer-col h3 { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 11px; }
.footer-col a { color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 14px; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 20px 0; text-align: center;
    color: rgba(255, 255, 255, .6); font-size: 13px;
}

/* ============================== Responsive ============================== */
@media (max-width: 1024px) {
    .app-layout { grid-template-columns: 1fr; }
    .app-aside { position: static; order: -1; }
    .fee-card { order: 0; }
}
@media (max-width: 768px) {
    .grid-3, .grid-2, .grid-2-uneven { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 600px) {
    .container { padding: 0 16px; }
    .header-inner { padding: 14px 16px; }
    .brand-logo img, .footer-logo { height: 38px; }
    .header-secure { display: none; }
    .form-section { padding: 22px 18px; }
    .section-title { font-size: 17px; }
    .form-actions { grid-template-columns: 1fr; }
    .success-card { padding: 40px 22px; }
    .reference-box { padding: 16px 28px; }
    .partner-card { min-width: 0; width: 100%; }
    .partners-row { flex-direction: column; align-items: stretch; }
}
