/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
    --blue-50:   #eff6ff;
    --blue-100:  #dbeafe;
    --blue-500:  #3b82f6;
    --blue-600:  #2563eb;
    --blue-700:  #1d4ed8;
    --blue-800:  #1e40af;
    --blue-900:  #1e3a8a;
    --navy:      #0c1a3d;
    --slate-50:  #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --red-50:    #fef2f2;
    --red-400:   #f87171;
    --red-500:   #ef4444;
    --red-600:   #dc2626;
    --green-50:  #f0fdf4;
    --green-400: #4ade80;
    --green-600: #16a34a;
    --r-sm: 8px;
    --r:    12px;
    --r-lg: 18px;
}

/* ── BASE ──────────────────────────────────────────────── */
html  { scroll-behavior: smooth; }
body  {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--slate-100);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37,99,235,.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(14,30,100,.06) 0%, transparent 55%);
    color: var(--slate-900);
    min-height: 100vh;
    padding: 3rem 1.25rem 5rem;
    line-height: 1.6;
}

/* ── WRAPPER ───────────────────────────────────────────── */
.form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    animation: rise .6s cubic-bezier(.16,1,.3,1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD ──────────────────────────────────────────────── */
.form-card {
    background: #fff;
    border-radius: var(--r-lg);
    border: 1px solid var(--slate-200);
    box-shadow:
        0 1px 2px  rgba(15,23,42,.06),
        0 6px 20px rgba(15,23,42,.07),
        0 24px 56px rgba(15,23,42,.07);
    overflow: hidden;
}

/* ── HEADER ────────────────────────────────────────────── */
.form-header {
    background: linear-gradient(140deg, var(--navy) 0%, #142050 45%, var(--blue-800) 100%);
    padding: 2.75rem 3rem 2.1rem;
    position: relative;
    overflow: hidden;
}

.form-header::before {
    content: '';
    position: absolute;
    top: -100px; right: -80px;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 65%);
    pointer-events: none;
}
.form-header::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -40px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
    pointer-events: none;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    position: relative;
    z-index: 1;
}

.logo-box {
    width: 70px; height: 70px;
    background: rgba(255,255,255,.13);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--r);
    display: flex; align-items: center; justify-content: center;
    padding: 9px;
    flex-shrink: 0;
}
.logo-box img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.header-copy h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.03em;
    line-height: 1.1;
}
.header-copy p {
    font-size: .85rem;
    color: rgba(255,255,255,.6);
    margin-top: .35rem;
    font-weight: 400;
    letter-spacing: .01em;
}

/* Steps row */
.steps-row {
    display: flex;
    align-items: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.step {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.step-badge {
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: .72rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    letter-spacing: .03em;
    flex-shrink: 0;
}
.step-badge.on  { background: #fff; color: var(--blue-700); box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.step-badge.off { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }

.step-text {
    font-size: .78rem;
    font-weight: 600;
    color: rgba(255,255,255,.75);
}

.step-line {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,.18);
    margin: 0 .85rem;
}

/* ── BODY ──────────────────────────────────────────────── */
.form-body {
    padding: 2.75rem 3rem;
}

/* Flash banners */
.flash {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: 1rem 1.25rem;
    border-radius: var(--r-sm);
    margin-bottom: 1.9rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.55;
    animation: dropIn .35s ease both;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash.success { background: var(--green-50);  border: 1.5px solid #86efac; color: var(--green-600); }
.flash.error   { background: var(--red-50);    border: 1.5px solid #fca5a5; color: var(--red-600); }
.flash-icon    { flex-shrink: 0; margin-top: 1px; }

/* Section heading */
.sec-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: 1.65rem;
    padding-left: 1.1rem;
    border-left: 3px solid var(--blue-600);
}
.sec-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
    color: #fff;
    font-weight: 800;
    font-size: .76rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: .04em;
    box-shadow: 0 2px 8px rgba(37,99,235,.28);
}
.sec-copy { padding-top: 2px; }
.sec-title { font-size: 1rem; font-weight: 800; color: var(--slate-900); letter-spacing: -.015em; }
.sec-desc  { font-size: .77rem; color: var(--slate-500); margin-top: .18rem; }

/* Section divider */
.sec-sep {
    height: 1px;
    background: linear-gradient(90deg, var(--blue-100) 0%, var(--slate-200) 50%, transparent 100%);
    margin: 2.5rem 0;
    position: relative;
}
.sec-sep::after {
    content: '';
    position: absolute;
    left: 0;
    top: -2px;
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
    opacity: .55;
}

/* Grid */
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.4rem; }
.full { grid-column: 1 / -1; }

/* Field */
.field { display: flex; flex-direction: column; gap: .38rem; }

.f-label {
    font-size: .79rem;
    font-weight: 700;
    color: var(--slate-700);
    letter-spacing: .015em;
}
.req { color: var(--red-500); margin-left: 2px; }

/* Inputs */
.f-in, .f-sel, .f-ta {
    width: 100%;
    padding: .72rem 1rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: .875rem;
    color: var(--slate-900);
    background: #fff;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
    appearance: none; -webkit-appearance: none;
    box-shadow: 0 1px 2px rgba(15,23,42,.05);
}
.f-in::placeholder, .f-ta::placeholder { color: var(--slate-400); font-weight: 400; }

.f-in:focus, .f-sel:focus, .f-ta:focus {
    border-color: var(--blue-500);
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(37,99,235,.10), 0 1px 2px rgba(15,23,42,.05);
}

.f-in.bad, .f-sel.bad, .f-ta.bad {
    border-color: var(--red-500);
    background: var(--red-50);
}

.f-sel {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-color: var(--slate-50);
    padding-right: 2.5rem;
}
.f-sel:focus { background-color: #fff; }

.f-ta { resize: vertical; min-height: 100px; line-height: 1.65; }

/* Field error */
.ferr { font-size: .73rem; color: var(--red-600); font-weight: 500; display: none; }
.ferr.on { display: block; }

/* ── LEAVE TYPE CARDS ───────────────────────────────────── */
.lt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .6rem;
    margin-top: .1rem;
}

.lt-card input[type="radio"] { display: none; }

.lt-card label {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .72rem 1rem;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
    color: var(--slate-600);
    background: #fff;
    transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
    user-select: none;
    line-height: 1.35;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    min-height: 48px;
}

.lt-card label:hover {
    border-color: #93c5fd;
    color: var(--blue-700);
    background: var(--blue-50);
    box-shadow: 0 2px 8px rgba(37,99,235,.10);
}

.lt-card input[type="radio"]:checked + label {
    border-color: var(--blue-600);
    background: linear-gradient(135deg, var(--blue-50) 0%, #eff6ff 100%);
    color: var(--blue-800);
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 2px 8px rgba(37,99,235,.1);
}

.lt-dot {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s;
    background: transparent;
}
.lt-dot::after {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: none;
}
.lt-card input[type="radio"]:checked + label .lt-dot {
    background: var(--blue-600);
    border-color: var(--blue-600);
}
.lt-card input[type="radio"]:checked + label .lt-dot::after { display: block; background: #fff; }

/* ── FOOTER ─────────────────────────────────────────────── */
.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.1rem;
    flex-wrap: wrap;
    padding: 1.5rem 3rem 1.9rem;
    background: var(--slate-50);
    border-top: 1px solid var(--slate-200);
}

.foot-note {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    font-size: .78rem;
    color: var(--slate-500);
    line-height: 1.5;
    max-width: 340px;
}
.foot-note svg { flex-shrink: 0; margin-top: 2px; opacity: .75; }

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .8rem 2rem;
    background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-600) 100%);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .015em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,.36), 0 1px 3px rgba(37,99,235,.2);
    transition: all .22s ease;
    position: relative;
    overflow: hidden;
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.1) 0%, transparent 60%);
    pointer-events: none;
}
.btn-submit:hover {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue-800) 60%, var(--blue-600) 100%);
    box-shadow: 0 8px 24px rgba(37,99,235,.45), 0 2px 6px rgba(37,99,235,.2);
    transform: translateY(-2px);
}
.btn-submit:active  { transform: translateY(0); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Spinner (used by JS on submit) */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 660px) {
    body            { padding: 1.5rem .9rem 4rem; }
    .form-header    { padding: 1.9rem 1.6rem 1.5rem; }
    .form-body      { padding: 1.9rem 1.6rem; }
    .form-footer    { padding: 1.3rem 1.6rem 1.6rem; flex-direction: column; align-items: stretch; }
    .btn-submit     { justify-content: center; width: 100%; }
    .fg             { grid-template-columns: 1fr; }
    .full           { grid-column: 1; }
    .header-copy h1 { font-size: 1.35rem; }
    .lt-grid        { grid-template-columns: 1fr 1fr; }
    .step-text      { display: none; }
}
@media (max-width: 400px) {
    .lt-grid { grid-template-columns: 1fr; }
}
