
/* ---------- CSS Variables ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a3c8f;
    --primary-dark: #102a6e;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --light: #94a3b8;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(26,60,143,.10);
    --shadow-lg: 0 12px 40px rgba(26,60,143,.16);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1a3c8f 50%, #1e40af 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: #fff;
}

.topbar-link {
    color: rgba(255,255,255,.75);
    font-size: .85rem;
    text-decoration: none;
}

    .topbar-link:hover {
        color: #fff;
    }

/* ── Main Layout ── */
.page-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 48px;
}

.login-card {
    background: var(--card);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
}

/* Tabs */
.tab-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 18px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: all .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

    .tab-btn.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
        background: rgba(26,60,143,.04);
    }

    .tab-btn:hover:not(.active) {
        background: var(--bg);
    }

/* Body */
.card-body {
    padding: 32px 36px;
}

@media(max-width:480px) {
    .card-body {
        padding: 24px 20px;
    }
}

.card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.card-sub {
    font-size: .88rem;
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Steps inside card */
.step-panel {
    display: none;
}

    .step-panel.active {
        display: block;
    }

/* Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
    letter-spacing: .02em;
}

.input-wrap {
    position: relative;
}

    .input-wrap .prefix {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: .9rem;
        font-weight: 600;
        color: var(--muted);
        pointer-events: none;
    }

input[type=tel], input[type=email], input[type=text], input[type=password]{
    width: 100%;
    padding: 13px 14px 13px 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}

    input[type=tel]:focus, input[type=email]:focus, input[type=text]:focus, input[type=password]:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(26,60,143,.12);
        background: #fff;
    }

input.no-prefix {
    padding-left: 14px;
}



input.error-field {
    border-color: var(--danger) !important;
}

/* OTP boxes */
.otp-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 6px;
}

.otp-box {
    width: 54px;
    height: 58px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: all .2s;
    padding:5px !important;
}

    .otp-box:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(26,60,143,.12);
        background: #fff;
    }

    .otp-box.filled {
        border-color: var(--primary);
        background: rgba(26,60,143,.06);
    }

/* Timer */
.otp-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
    margin-top: 12px;
}

.timer {
    color: var(--muted);
}

    .timer span {
        color: var(--primary);
        font-weight: 600;
    }

.resend-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: none;
}

    .resend-btn:disabled {
        color: var(--light);
        cursor: not-allowed;
    }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .25s;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(26,60,143,.3);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

    .btn-primary:disabled {
        opacity: .6;
        cursor: not-allowed;
        transform: none;
    }

.btn-outline-sm {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--muted);
    padding: 9px 16px;
    font-size: .83rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all .2s;
}

    .btn-outline-sm:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

/* Change link */
.change-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-top: -8px;
    margin-bottom: 20px;
}

    .change-link:hover {
        text-decoration: underline;
    }

/* Info box */
.info-chip {
    background: rgba(26,60,143,.07);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: .82rem;
    color: var(--primary-dark);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    line-height: 1.5;
    margin-top:20px;
}

    .info-chip i {
        margin-top: 2px;
        flex-shrink: 0;
    }

/* Identifier display */
.id-display {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    font-size: .8rem;
    color: var(--light);
}

    .divider::before, .divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

/* Sign-up link */
.signup-line {
    text-align: center;
    font-size: .85rem;
    color: var(--muted);
    margin-top: 24px;
}

    .signup-line a {
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
    }

        .signup-line a:hover {
            text-decoration: underline;
        }

/* Toast */
#toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1e293b;
    color: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: .88rem;
    font-weight: 500;
    z-index: 9999;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

    #toast.show {
        transform: translateX(-50%) translateY(0);
    }

    #toast.success {
        background: var(--success);
    }

    #toast.error {
        background: var(--danger);
    }

    #toast.warn {
        background: var(--warning);
        color: #1e293b;
    }

/* Loading spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    font-size: .78rem;
    color: rgba(255,255,255,.45);
}

    footer a {
        color: rgba(255,255,255,.55);
        text-decoration: none;
    }

        footer a:hover {
            color: #fff;
        }

/* Dots animation */
.dots {
    display: inline-flex;
    gap: 4px;
}

    .dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255,255,255,.8);
        animation: bounce .9s infinite;
    }

        .dots span:nth-child(2) {
            animation-delay: .15s;
        }

        .dots span:nth-child(3) {
            animation-delay: .3s;
        }

@keyframes bounce {
    0%,80%,100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }
}

/* Trust row */
.trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: var(--light);
}

    .trust-item i {
        color: var(--success);
        font-size: .8rem;
    }
