/* ===== NEMBHARAT Tokens ===== */
:root {
    --indigo: #3f51b5;
    --indigo-deep: #1a237e;
    --indigo-light: #c5cae9;
    --indigo-glow: rgba(63, 81, 181, 0.25);
    --primary: #0244fa;
    --primary-light: #e8eeff;
    --accent: #00b0f0;
    --navy: #203864;
    --navy-dark: #0a1929;
    --surface: #ffffff;
    --surface-alt: #f2f3f5;
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.22);
    --text: #424242;
    --text-secondary: #767171;
    --text-title: #3b3838;
    --text-muted: #9098b1;
    --border: #e2e5f1;
    --error: #e53935;
    --font: 'Noto Sans', sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    color: var(--text);
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 30%, #e8eeff 70%, #f2f3f5 100%);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--indigo-deep); }

/* ===== Animated Background Blobs ===== */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: blobFloat 18s ease-in-out infinite alternate;
}

.blob-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #7986cb, #3f51b5);
    top: -10%; left: -10%;
    animation-duration: 20s;
}

.blob-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #5c6bc0, #1a237e);
    bottom: -5%; right: -8%;
    animation-duration: 16s;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #42a5f5, #0244fa);
    top: 40%; left: 50%;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes blobFloat {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(60px, -40px) scale(1.1); }
    66%  { transform: translate(-30px, 50px) scale(0.95); }
    100% { transform: translate(20px, -20px) scale(1.05); }
}

/* ===== Floating Particles ===== */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(63, 81, 181, 0.3);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Layout ===== */
.layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: 100vh;
}

/* ===== Side Panel ===== */
.side-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-panel-bg {
    position: absolute;
    inset: 0;
}

.side-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(26, 35, 126, 0.92) 0%,
        rgba(63, 81, 181, 0.85) 40%,
        rgba(2, 68, 250, 0.78) 100%
    );
    backdrop-filter: blur(2px);
}

.side-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 36px 32px;
    min-height: 100vh;
}

.side-logo {
    display: inline-flex;
}

.logo-img {
    height: 52px;
    width: auto;
}

.side-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}

.side-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.side-title span {
    color: var(--accent);
}

.side-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 320px;
}

.side-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.side-feat {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
}

.side-feat svg {
    flex-shrink: 0;
    color: var(--accent);
}

.side-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.side-weml-logo {
    height: 18px;
    width: auto;
}

.side-footer p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===== Form Panel ===== */
.form-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 32px;
    overflow-y: auto;
}

.form-scroll {
    width: 100%;
    max-width: 580px;
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(63, 81, 181, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 44px 40px;
}

.mobile-logo {
    display: none;
}

.logo-img-mobile {
    height: 40px;
    width: auto;
    margin-bottom: 20px;
}

.form-header {
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--indigo-light);
}

.form-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--indigo-deep);
    margin-bottom: 6px;
}

.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.req { color: var(--error); font-weight: 700; }

/* ===== Form Group ===== */
.form-group { margin-bottom: 26px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--indigo-deep);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.field-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== Inputs with Glow ===== */
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border);
    background: transparent;
    transition: border-color 0.3s var(--ease);
}

.input-glow {
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--indigo), var(--accent));
    transition: all 0.4s var(--ease);
    transform: translateX(-50%);
    box-shadow: 0 0 0 0 transparent;
}

.input-wrap:focus-within .input-glow {
    width: 100%;
    box-shadow: 0 2px 16px var(--indigo-glow);
}

.input-wrap:focus-within {
    border-bottom-color: transparent;
}

.input-wrap:focus-within .field-icon {
    color: var(--indigo);
    transform: scale(1.1);
}

.field-icon {
    position: absolute;
    left: 0;
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
}

.input-prefix {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    padding-right: 8px;
    border-right: 1px solid var(--border);
    margin-right: 8px;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    padding: 12px 0 12px 30px;
}

.input-wrap input::placeholder { color: var(--text-muted); }

.select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 28px;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-muted);
    pointer-events: none;
    transition: 0.3s var(--ease);
}

.select-wrap:focus-within::after { border-top-color: var(--indigo); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Error */
.field-error {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    min-height: 16px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-4px);
    transition: 0.25s var(--ease);
}

.field-error.visible { opacity: 1; transform: translateY(0); }

.form-group.has-error .input-wrap { border-bottom-color: var(--error); }
.form-group.has-error .input-glow { background: var(--error); width: 100%; }
.form-group.has-error .field-icon { color: var(--error); }

/* ===== Vehicle Cards ===== */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.v-opt input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.v-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 10px;
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    text-align: center;
    color: var(--text-secondary);
}

.v-card span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.v-card:hover {
    border-color: var(--indigo);
    background: rgba(63, 81, 181, 0.06);
    color: var(--indigo);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--indigo-glow);
}

.v-opt input:checked + .v-card {
    border-color: var(--indigo);
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.08), rgba(0, 176, 240, 0.06));
    color: var(--indigo);
    box-shadow: 0 0 0 1px var(--indigo), 0 4px 16px var(--indigo-glow);
    transform: translateY(-2px);
}

.v-opt input:checked + .v-card svg { stroke: var(--indigo); }

/* ===== CAPTCHA ===== */
.captcha-box {
    background: linear-gradient(135deg, rgba(63, 81, 181, 0.06), rgba(197, 202, 233, 0.2));
    border: 1px solid var(--indigo-light);
    padding: 20px;
}

.captcha-challenge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.captcha-question {
    font-size: 20px;
    font-weight: 800;
    color: var(--indigo-deep);
    letter-spacing: 0.06em;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    border: 1px dashed var(--indigo-light);
    user-select: none;
}

.captcha-refresh {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--indigo);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease);
}

.captcha-refresh:hover {
    background: var(--indigo-deep);
    transform: rotate(180deg);
}

.captcha-input-wrap {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== Submit Button ===== */
.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--indigo-deep), var(--indigo));
    color: white;
    padding: 16px 32px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 8px;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--indigo), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--indigo-glow);
}

.submit-btn:hover::before { left: 100%; }
.submit-btn:active { transform: translateY(0); }

.btn-loader { display: none; }
.submit-btn.loading .btn-text,
.submit-btn.loading .btn-arrow { display: none; }
.submit-btn.loading .btn-loader { display: flex; }
.submit-btn.loading { pointer-events: none; opacity: 0.8; }

.spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
}
.form-footer-note a { color: var(--indigo); font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 35, 126, 0.35);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s var(--ease);
    padding: 24px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    padding: 44px 36px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    transform: translateY(16px) scale(0.97);
    transition: 0.3s var(--ease);
    box-shadow: 0 20px 60px rgba(26, 35, 126, 0.15);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-check {
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.check-ring {
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 50%;
    animation: ringPulse 1.5s ease-out infinite;
}

@keyframes ringPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.check-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: checkDraw 0.5s 0.3s ease forwards;
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

.modal h3 { font-size: 20px; font-weight: 700; color: var(--indigo-deep); margin-bottom: 10px; }
.modal p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }

.modal-btn {
    display: inline-flex;
    background: linear-gradient(135deg, var(--indigo-deep), var(--indigo));
    color: white;
    padding: 12px 32px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: 0.3s var(--ease);
}
.modal-btn:hover {
    background: linear-gradient(135deg, var(--indigo), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--indigo-glow);
}

/* ===== Entrance Animations ===== */
.anim-slide-up {
    opacity: 0;
    transform: translateY(24px);
    animation: slideUp 0.7s var(--ease) forwards;
}
.anim-delay-1 { animation-delay: 0.15s; }
.anim-delay-2 { animation-delay: 0.3s; }

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.anim-fade-in {
    opacity: 0;
    animation: fadeIn 0.6s 0.1s var(--ease) forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.anim-field {
    opacity: 0;
    transform: translateX(20px);
    animation: fieldSlide 0.5s var(--ease) forwards;
}

.anim-field:nth-child(1)  { animation-delay: 0.15s; }
.anim-field:nth-child(2)  { animation-delay: 0.22s; }
.anim-field:nth-child(3)  { animation-delay: 0.29s; }
.anim-field:nth-child(4)  { animation-delay: 0.36s; }
.anim-field:nth-child(5)  { animation-delay: 0.43s; }
.anim-field:nth-child(6)  { animation-delay: 0.50s; }
.anim-field:nth-child(7)  { animation-delay: 0.57s; }
.anim-field:nth-child(8)  { animation-delay: 0.64s; }
.anim-field:nth-child(9)  { animation-delay: 0.71s; }

/* Extra delay for rows */
.form-row .anim-field:nth-child(1) { animation-delay: inherit; }
.form-row .anim-field:nth-child(2) { animation-delay: inherit; }

@keyframes fieldSlide {
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side-panel {
        display: none;
    }

    .mobile-logo {
        display: block;
    }

    .form-panel {
        padding: 24px 16px;
    }

    .form-scroll {
        padding: 28px 20px;
    }

    .form-header h1 {
        font-size: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .vehicle-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .v-card {
        padding: 14px 8px;
    }

    .blob-1 { width: 300px; height: 300px; }
    .blob-2 { width: 250px; height: 250px; }
    .blob-3 { width: 200px; height: 200px; }
}

@media (max-width: 480px) {
    .captcha-question {
        font-size: 16px;
        padding: 6px 14px;
    }

    .form-scroll {
        backdrop-filter: blur(16px);
    }
}
