/* ═══════════════════════════════════════════════════
   DESIGN TOKENS — Light Professional Theme
   ═══════════════════════════════════════════════════ */
:root {
    --font: 'Poppins', sans-serif;

    /* Brand */
    --primary:        #0f5ca8;
    --primary-dark:   #0a4480;
    --primary-light:  #e8f1fb;
    --primary-mid:    #c8ddf6;
    --accent:         #059669;
    --accent-light:   #ecfdf5;
    --danger:         #dc2626;
    --danger-light:   #fef2f2;
    --warning:        #d97706;
    --warning-light:  #fffbeb;

    /* Surfaces */
    --bg:             #f0f4f9;
    --surface:        #ffffff;
    --surface-subtle: #f8fafc;
    --border:         #e2e8f0;
    --border-focus:   #93c5fd;

    /* Text */
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-inverse:   #ffffff;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-md:  0 4px 12px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.05);
    --shadow-lg:  0 10px 32px rgba(15,23,42,0.12), 0 4px 12px rgba(15,23,42,0.06);
    --shadow-xl:  0 20px 48px rgba(15,23,42,0.14);

    --radius:    10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --ease:      cubic-bezier(0.4,0,0.2,1);
    --spring:    cubic-bezier(0.34,1.56,0.64,1);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    /* NOTE: no overflow:hidden here — that was breaking mobile scroll */
}

/* Desktop only: lock scroll so the two-col layout fills the screen */
@media (min-width: 821px) {
    html, body { overflow: hidden; }
}

/* ═══════════════════════════════════════════════════
   PAGE LAYOUT — 2-column split
   ═══════════════════════════════════════════════════ */
.page-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ── Tablet: stack vertically, allow scroll ── */
@media (max-width: 820px) {
    .page-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
}

/* ═══════════════════════════════════════════════════
   LEFT — Brand Panel
   ═══════════════════════════════════════════════════ */
.brand-panel {
    position: relative;
    overflow: hidden;
    
/* ── Adjustable Image Overlay ── */
    background-color: #0077b6; /* Solid fallback */
    
    background-image: 
        /* 1. Color Overlay: Using #0077b6 (RGB: 0, 119, 182). Adjust 0.85 for opacity */
        linear-gradient(rgba(0, 119, 182, 0.75), rgba(0, 119, 182, 0.75)),
        /* 2. Background Image */
        url('../../assets/img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* This blends the image perfectly into the --primary blue color */
    background-blend-mode: multiply; 
    
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.25rem;
}

/* Layered mesh */
.brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 15% 15%, rgba(255,255,255,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 55% 70% at 85% 85%, rgba(5,150,105,0.18) 0%, transparent 55%),
        radial-gradient(ellipse 45% 45% at 70% 30%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

/* Subtle dot grid */
.brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.09) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Decorative circles */
.brand-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.brand-deco-1 {
    width: 360px; height: 360px;
    border: 1.5px solid rgba(255,255,255,0.10);
    top: -90px; right: -90px;
}
.brand-deco-2 {
    width: 220px; height: 220px;
    border: 1.5px solid rgba(255,255,255,0.07);
    bottom: 80px; left: -50px;
}
.brand-deco-3 {
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.05);
    bottom: 200px; right: 40px;
    animation: floatSlow 7s ease-in-out infinite;
}
@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-14px); }
}

/* Brand content */
.brand-top {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gov-seal-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.gov-seal {
    width: 42px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-logo {
    width: 300px; height: 100px;
    display: flex; align-items: center; justify-content: center;
}
.gov-label-top {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.gov-label-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    margin-top: 0.1rem;
}

.brand-divider {
    height: 1px;
    background: rgba(255,255,255,0.15);
}

.brand-headline-kicker {
    font-size: 0.63rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
}
.brand-headline-kicker::before {
    content: '';
    display: inline-block;
    width: 18px; height: 2px;
    background: rgba(255,255,255,0.45);
    border-radius: 1px;
}

.brand-headline-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.12;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.brand-headline-title span {
    color: #a3d9c7;
}

.brand-headline-sub {
    margin-top: 1rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
    max-width: 310px;
    font-weight: 400;
}

/* Feature rows */
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.feature-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    opacity: 0;
    animation: featureSlide 0.45s var(--ease) forwards;
}
.feature-row:nth-child(1) { animation-delay: 0.55s; }
.feature-row:nth-child(2) { animation-delay: 0.70s; }
.feature-row:nth-child(3) { animation-delay: 0.85s; }
@keyframes featureSlide {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: none; }
}
.feature-dot {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    flex-shrink: 0;
}
.feature-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.72);
    font-weight: 500;
}

.brand-bottom {
    position: relative;
    z-index: 2;
}
.brand-bottom-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 99px;
    font-size: 0.63rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.brand-bottom-badge i { color: #a3d9c7; }

/* ── Mobile (≤820px): slim header — only gov-seal-row visible ── */
@media (max-width: 820px) {
    .brand-panel {
        padding: 0.9rem 1.25rem;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        min-height: unset;
    }
    .brand-top       { flex-direction: row; align-items: center; gap: 0; }
    .brand-divider   { display: none; }
    .brand-headline  { display: none; }
    .brand-features  { display: none; }
    .brand-bottom    { display: none; }
    .brand-deco-1,
    .brand-deco-2,
    .brand-deco-3    { display: none; }
    /* Hide everything inside brand-top except gov-seal-row */
    .brand-top > *:not(.gov-seal-row) { display: none; }
}

@media (max-width: 480px) {
    .brand-panel   { padding: 0.75rem 1rem; }
    .gov-seal      { width: 34px; height: 34px; }
    .gov-label-top { font-size: 0.5rem; }
    .gov-label-name{ font-size: 0.65rem; }
}

/* ═══════════════════════════════════════════════════
   RIGHT — Form Panel
   ═══════════════════════════════════════════════════ */
.form-panel {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    overflow-y: auto;
    position: relative;
}

/* Subtle corner accents */
.form-panel::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 200px; height: 200px;
    background: radial-gradient(circle at top right, var(--primary-light), transparent 65%);
    pointer-events: none;
}
.form-panel::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 160px; height: 160px;
    background: radial-gradient(circle at bottom left, var(--accent-light), transparent 65%);
    pointer-events: none;
}

.form-inner {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: panelIn 0.45s var(--ease) both;
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ── Mobile: slim header + form fills remaining height ── */
@media (max-width: 820px) {
    .page-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: 100vh;
        overflow: hidden;
    }
    .form-panel {
        justify-content: center;
        padding: 2rem 1.5rem 2.5rem;
        height: 100%;
        overflow-y: auto;
    }
    .form-inner { max-width: 420px; }
}

/* ── Small phone ── */
@media (max-width: 480px) {
    .form-panel { padding: 1.5rem 1rem 2rem; }
}

/* ── Very small phone (≤360px) ── */
@media (max-width: 360px) {
    .form-panel { padding: 1.25rem 0.75rem 1.75rem; }
}

/* ─── Form header ─────────────────────────────────── */
.form-header { margin-bottom: 1.5rem; }

.form-header-icon {
    width: 52px; height: 52px;
    background: var(--primary);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(15,92,168,0.28);
    margin-bottom: 1.25rem;
    animation: iconPop 0.45s var(--spring) 0.15s both;
}
@keyframes iconPop {
    from { transform: scale(0.65) rotate(-8deg); opacity: 0; }
    to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.form-subtitle {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 400;
}

@media (max-width: 480px) {
    .form-header { margin-bottom: 1.1rem; }
    .form-header-icon { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 11px; margin-bottom: 0.9rem; }
    .form-title   { font-size: 1.25rem; }
    .form-subtitle { font-size: 0.73rem; }
}

/* ─── Step indicator ─────────────────────────────── */
.step-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.7rem 0.85rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden; /* prevent bleed on tiny screens */
}
.step-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    justify-content: center;
    min-width: 0; /* allow flex shrink */
}
.step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: all 0.3s var(--ease);
}
.step-item.active  .step-num { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(15,92,168,0.35); }
.step-item.pending .step-num { background: var(--border); color: var(--text-muted); }
.step-item.done    .step-num { background: var(--accent-light); color: var(--accent); border: 1.5px solid var(--accent); }
.step-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.step-item.active  .step-label { color: var(--primary); }
.step-item.pending .step-label { color: var(--text-muted); }
.step-item.done    .step-label { color: var(--accent); }
.step-connector { flex-shrink: 0; width: 20px; height: 1px; background: var(--border); }

@media (max-width: 360px) {
    .step-indicator { padding: 0.6rem 0.6rem; }
    .step-connector { width: 10px; }
    .step-label     { font-size: 0.56rem; letter-spacing: 0.04em; }
    .step-num       { width: 19px; height: 19px; font-size: 0.55rem; }
}

/* ─── Alert ──────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 1.25rem;
    animation: alertIn 0.3s var(--ease) both;
}
@keyframes alertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}
.alert-error {
    background: var(--danger-light);
    border: 1px solid #fca5a5;
    color: var(--danger);
}
.alert-error i { color: var(--danger); font-size: 1rem; flex-shrink: 0; margin-top: 0.05rem; }

@media (max-width: 480px) {
    .alert { font-size: 0.73rem; padding: 0.75rem 0.85rem; }
}

/* ─── Form fields ────────────────────────────────── */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.field-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.field-label i { font-size: 0.78rem; color: var(--primary); }

.field-input-wrap { position: relative; }

.field-input {
    width: 100%;
    background: var(--surface-subtle);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.8rem 2.75rem 0.8rem 1rem;
    outline: none;
    transition: all 0.2s var(--ease);
    min-height: 48px;
    /* Prevents iOS zoom on focus (font-size must be ≥16px on iOS) */
    font-size: max(0.9rem, 16px);
}
.field-input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(15,92,168,0.1);
}
.field-input.has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.field-input::placeholder { color: var(--text-muted); font-weight: 400; }

/* Ensure tap targets are big enough on touch */
@media (max-width: 820px) {
    .field-input { min-height: 52px; }
}

.field-eye-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex; align-items: center; justify-content: center;
    min-width: 36px; min-height: 36px; /* larger touch target */
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}
.field-eye-btn:hover  { color: var(--primary); background: var(--primary-light); }
.field-eye-btn:active { color: var(--primary); }

/* ─── Options row ────────────────────────────────── */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    margin-bottom: 1.25rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    /* Bigger touch target */
    padding: 0.35rem 0;
}
.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .options-row { font-size: 0.7rem; }
}

/* ─── Submit button ──────────────────────────────── */
.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: all 0.2s var(--ease);
    box-shadow: 0 4px 16px rgba(15,92,168,0.3);
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    min-height: 52px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
}
.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(15,92,168,0.38);
}
.btn-submit:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(15,92,168,0.25); }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-submit .spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-label { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Larger tap area on mobile */
@media (max-width: 820px) {
    .btn-submit { min-height: 56px; font-size: 0.95rem; }
}

/* ─── Form footer ────────────────────────────────── */
.form-footer {
    margin-top: 1.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: center;
}
.form-footer-notice {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.form-footer-notice strong { color: var(--text-secondary); font-weight: 600; }
.form-footer-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    color: var(--text-muted);
}
.form-footer-support i { font-size: 0.78rem; color: var(--primary); }

@media (max-width: 480px) {
    .form-footer { margin-top: 1.25rem; padding-top: 1rem; }
    .form-footer-notice,
    .form-footer-support { font-size: 0.63rem; }
}

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface-subtle); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }