:root {
    --bg: #0a0c10;
    --bg-2: #0c1118;
    --panel: #0f151e;
    --line: #1a2230;
    --glass: rgba(255, 255, 255, 0.06);
    --text: #e9f1fa;
    --muted: #9fb0c7;
    --brand: #42a5f5;
    --brand-2: #2e78d1;
    --danger: #ef476f;
    --success: #22c55e;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html,
body {
    background: radial-gradient(
            900px 420px at 110% -10%,
            rgba(66, 165, 245, 0.18),
            transparent 60%
        ),
        radial-gradient(
            850px 380px at -10% -10%,
            rgba(126, 87, 194, 0.16),
            transparent 60%
        ),
        linear-gradient(180deg, var(--bg) 0%, #0b0f15 100%);
    color: var(--text);
    font-family: "Noto Sans Thai", system-ui, -apple-system, Segoe UI, Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

/* -------- Loader -------- */
#loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: #06080d;
    z-index: 9999;
}

.spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--brand);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* -------- Entrance animation helpers -------- */
.fade-up {
    opacity: 0;
    transform: translateY(14px);
}

.fade-up.in {
    opacity: 1;
    transform: none;
    transition: 0.55s cubic-bezier(0.22, 0.8, 0.25, 1);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    align-items: center;
}

/* LEFT brand pane */
.brand-pane {
    background: radial-gradient(
            650px 300px at 30% 20%,
            rgba(66, 165, 245, 0.18),
            transparent 60%
        ),
        radial-gradient(
            600px 280px at 100% 70%,
            rgba(255, 255, 255, 0.06),
            transparent 60%
        ),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04),
            rgba(255, 255, 255, 0.02)
        );
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.brand-pane .logo {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0.5px;
    line-height: 1;
}

.brand-pane .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #263044;
    background: rgba(255, 255, 255, 0.07);
    font-weight: 800;
}

.orb {
    position: absolute;
    filter: blur(42px);
    opacity: 0.75;
    border-radius: 50%;
    pointer-events: none;
}

.orb.blue {
    background: rgba(66, 165, 245, 0.45);
    width: 180px;
    height: 180px;
    top: 10%;
    left: 6%;
    animation: float 7s ease-in-out infinite;
}

.orb.purple {
    background: rgba(170, 142, 255, 0.34);
    width: 220px;
    height: 220px;
    right: -60px;
    top: 30%;
    animation: float 9s ease-in-out infinite reverse;
}

.orb.cyan {
    background: rgba(0, 255, 214, 0.2);
    width: 160px;
    height: 160px;
    bottom: -40px;
    left: 22%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-14px);
    }
}

/* RIGHT card */
.cardx {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.04)
    );
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: saturate(150%) blur(8px);
}

.logo-mini {
    font-family: "Bebas Neue", sans-serif;
    font-size: 28px;
    letter-spacing: 0.5px;
}

.text-mutedx {
    color: var(--muted) !important;
}

/* Inputs + Icons (centered perfectly) */
.form-control {
    background: #0e131a;
    border: 1px solid #202637;
    color: #e7f0ff;
    border-radius: 12px;
    padding: 0.9rem 3rem 0.9rem 3rem;
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem rgba(66, 165, 245, 0.2);
    background: #0e131a;
    color: #fff;
}

.with-icon {
    position: relative;
}

.input-icon,
.toggle-pass {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
}

.input-icon {
    left: 8px;
    color: #7f8aa3;
    font-size: 18px;
}

.toggle-pass {
    right: 6px;
    border: 0;
    background: transparent;
    color: #9fb0c7;
    border-radius: 10px;
}

.toggle-pass:hover {
    background: rgba(255, 255, 255, 0.06);
}

.toggle-pass:active {
    transform: translateY(-50%) scale(0.98);
}

/* Buttons with micro-interactions */
.btn-brand {
    --g1: var(--brand);
    --g2: var(--brand-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 0;
    border-radius: 12px;
    color: #fff !important;
    font-weight: 900;
    letter-spacing: 0.1px;
    background: linear-gradient(135deg, var(--g1), var(--g2));
    transition: transform 0.08s ease, filter 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 16px 48px rgba(66, 165, 245, 0.3);
}

.btn-brand:hover {
    filter: brightness(1.06);
    box-shadow: 0 22px 64px rgba(66, 165, 245, 0.4);
    color: #fff !important;
}

.btn-brand:active {
    transform: translateY(1px);
}

.btn-ghost {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transition: color 0.25s ease, box-shadow 0.25s ease;
}

.btn-ghost:hover {
    box-shadow: 0 8px 26px rgba(66, 165, 245, 0.25);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.35);
    animation: ripple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.hint {
    display: none;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.hint.show {
    display: block;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
}

.back-link:hover {
    color: #cfe2ff;
}

@media (max-width: 375.98px) {
    .p-xs-2 {
        padding: 0.5rem !important;
    }
}

@media (min-width: 992px) {
    .pane-pad {
        padding: 2.2rem 2.4rem;
    }

    .pane-h {
        min-height: 640px;
    }
}

/* ===== Equal-height fix for both panes ===== */
.pane-fill {
    height: 100%;
}

.row.align-items-stretch > [class*="col"] > section {
    height: 100%;
}

.btn-brand i {
    color: #fff !important;
}

/* ===== Liquid Glass Success Modal ===== */
.glass-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 13, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: none;
}

.glass-modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 1060;
}

.glass-card {
    width: min(520px, 92vw);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.05)
    );
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 22px 22px 18px;
}

.glass-card h5 {
    margin: 0 0 6px 0;
    font-weight: 900;
}

.glass-card p {
    margin: 0;
    color: var(--muted);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(66, 165, 245, 0.16);
    border: 1px solid #264a7a;
    font-weight: 900;
    font-size: 20px;
    color: #eaf2ff;
    margin-right: 10px;
}

.go-home-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1070;
    width: auto;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
}

.form-control.is-invalid,
.form-control.is-valid,
.was-validated .form-control:invalid,
.was-validated .form-control:valid {
    background-image: none !important;
    padding-right: 3rem !important;
}

.with-icon .toggle-pass {
    z-index: 2;
}

:root {
    --ph-color: #6b7686;
}

.form-control::placeholder {
    color: var(--ph-color);
    opacity: 1;
}

.form-control:focus::placeholder {
    opacity: 0.5;
}
