:root {
    --navy: #0b1d35;
    --navy-mid: #112849;
    --navy-light: #1a3560;
    --accent: #3b82f6;
    --accent-glow: #60a5fa;
    --mint: #10b981;
    --rose: #f43f5e;
    --amber: #f59e0b;
    --form-bg: rgba(255, 255, 255, 0.97);
    --form-bdr: #e2e8f0;
    --form-focus: #3b82f6;
    --form-text: #1e293b;
    --form-muted: #94a3b8;
    --form-label: #475569;
    --error-col: #ef4444;
    --r-card: 22px;
    --r-input: 10px;
    --shadow-card: 0 32px 80px rgba(0, 0, 0, 0.50), 0 0 0 1px rgba(255, 255, 255, 0.09);
    --shadow-role: 0 4px 20px rgba(59, 130, 246, 0.38);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: var(--navy);
    overflow-x: hidden;
}

/* ── BACKGROUND ─────────────────────────── */
.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(145deg, #060d1f 0%, #0b1d35 40%, #0d2244 70%, #071528 100%);
}

.bg-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 15%, rgba(59, 130, 246, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 80%, rgba(16, 185, 129, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 65% 5%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.40;
    animation: orb-drift 14s ease-in-out infinite alternate;
}

.bg-orb-1 {
    width: 560px;
    height: 560px;
    background: rgba(59, 130, 246, 0.22);
    top: -140px;
    left: -100px;
    animation-duration: 16s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(16, 185, 129, 0.18);
    bottom: -90px;
    right: -70px;
    animation-duration: 12s;
    animation-delay: -5s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.20);
    top: 45%;
    right: 12%;
    animation-duration: 18s;
    animation-delay: -8s;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 64px 64px;
}

@keyframes orb-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(28px, 18px) scale(1.07);
    }
}

/* ── PAGE WRAP ──────────────────────────── */
.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ── GLASS CARD ─────────────────────────── */
.glass-card {
    width: 100%;
    max-width: 468px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 44px 44px 40px;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

@media (max-width: 520px) {
    .glass-card {
        padding: 30px 22px 26px;
    }
}

/* ── BRAND ──────────────────────────────── */
.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0b1d35 0%, #1a3560 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.brand-name {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.brand-name span {
    color: var(--accent);
}

.card-headline {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 20px 0 4px;
    line-height: 1.2;
}

.card-sub {
    font-size: 14px;
    color: var(--form-muted);
    margin-bottom: 28px;
}

/* ── ROLE GRID ──────────────────────────── */
.field-label-sm {
    font-size: 11px;
    font-weight: 600;
    color: var(--form-label);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: block;
    margin-bottom: 10px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 6px;
}

.role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 4px;
    border: 1.5px solid var(--form-bdr);
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.20s ease;
    font-size: 10.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    position: relative;
    outline: none;
}

.role-btn i {
    font-size: 20px;
    transition: all 0.20s;
}

.role-btn:hover {
    border-color: var(--accent);
    background: #eff6ff;
    color: var(--accent);
    transform: translateY(-2px);
}

.role-btn.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--accent);
    box-shadow: var(--shadow-role);
    transform: translateY(-2px);
}

.role-btn .check-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 7px;
    display: none;
    align-items: center;
    justify-content: center;
}

.role-btn.active .check-dot {
    display: flex;
}

.field-error-inline {
    font-size: 12px;
    color: var(--error-col);
    margin-bottom: 14px;
    display: none;
}

.field-error-inline.show {
    display: block;
}

/* ── INPUTS ─────────────────────────────── */
.field-group {
    margin-bottom: 18px;
}

.input-wrap {
    position: relative;
}

.ic-left {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.field-group:focus-within .ic-left {
    color: var(--accent);
}

.ml-input {
    width: 100%;
    height: 48px;
    background: #fff;
    border: 1.5px solid var(--form-bdr);
    border-radius: var(--r-input);
    padding: 0 44px 0 40px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--form-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ml-input::placeholder {
    color: #cbd5e1;
}

.ml-input:focus {
    border-color: var(--form-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.ml-input.is-invalid {
    border-color: var(--error-col);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10);
}

.ic-right-btn {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    padding: 0;
    transition: color 0.2s;
}

.ic-right-btn:hover {
    color: var(--accent);
}

.field-error {
    font-size: 12px;
    color: var(--error-col);
    margin-top: 5px;
    display: none;
}

.field-error.show {
    display: block;
}

/* phone prefix */
.phone-prefix {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 10px 0 40px;
    font-size: 14px;
    font-weight: 600;
    color: var(--form-text);
    border-right: 1.5px solid var(--form-bdr);
    pointer-events: none;
    user-select: none;
}

.phone-input {
    padding-left: 114px !important;
}

/* toggle method row */
.toggle-method-row {
    position: absolute;
    display: flex;
    justify-content: flex-end;
    /* margin-top: -8px; */
    margin-bottom: 18px;
    top: 0px;
    right: 0px;
}

.toggle-method-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    transition: opacity 0.2s;
}

.toggle-method-btn:hover {
    opacity: 0.70;
}

/* forgot row */
.forgot-row {
    position: absolute;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 7px;
    right: 0;
}

.forgot-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ── SUBMIT BUTTON ──────────────────────── */
.ml-btn-submit {
    width: 100%;
    height: 52px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: #fff;
    border: none;
    border-radius: 11px;
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    letter-spacing: 0.01em;
}

.ml-btn-submit:hover {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.30);
}

.ml-btn-submit:active {
    transform: translateY(0);
}

.ml-btn-submit:disabled {
    opacity: 0.65;
    pointer-events: none;
}

.ml-btn-submit.loading .btn-text {
    display: none;
}

.ml-btn-submit.loading .btn-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-spinner {
    display: none;
}

/* ── CARD FOOTER ────────────────────────── */
.card-footer-row {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-link-text {
    font-size: 13px;
    color: var(--form-muted);
    margin: 0;
}

.footer-link-text a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.footer-link-text a:hover {
    text-decoration: underline;
}

.encrypt-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.encrypt-badge i {
    color: var(--mint);
    font-size: 13px;
}

/* ── TOASTER ────────────────────────────── */
#toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 270px;
    max-width: 340px;
    padding: 13px 15px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    pointer-events: all;
    animation: toast-in 0.33s cubic-bezier(.34, 1.56, .64, 1);
    overflow: hidden;
    position: relative;
}

.toast-success {
    border-left: 4px solid var(--mint);
}

.toast-error {
    border-left: 4px solid var(--rose);
}

.toast-warning {
    border-left: 4px solid var(--amber);
}

.toast-icon {
    font-size: 17px;
    margin-top: 1px;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--mint);
}

.toast-error .toast-icon {
    color: var(--rose);
}

.toast-warning .toast-icon {
    color: var(--amber);
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.toast-msg {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    animation: toast-progress 3.5s linear forwards;
}

.toast-success .toast-progress {
    background: var(--mint);
}

.toast-error .toast-progress {
    background: var(--rose);
}

.toast-warning .toast-progress {
    background: var(--amber);
}

.toast-close {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 13px;
    padding: 0;
    transition: color 0.15s;
}

.toast-close:hover {
    color: #475569;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(36px) scale(0.92)
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1)
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(36px) scale(0.90)
    }
}

@keyframes toast-progress {
    from {
        width: 100%
    }

    to {
        width: 0%
    }
}

/* ── PAGE COPYRIGHT ─────────────────────── */
.page-copyright {
    position: fixed;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
    letter-spacing: 0.04em;
    white-space: nowrap;
    z-index: 1;
}

@media (max-width: 420px) {
    .role-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .role-btn{
        padding: 8px 4px;
        font-size: 8px;
    }
}