*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sun-gold: #F5A623;
    --sun-orange: #F07A1A;
    --sky-deep: #0a1628;
    --sky-mid: #112240;
    --sky-light: #1a3458;
    --horizon: #1e4080;
    --accent: #4FC3F7;
    --text-bright: #FFFFFF;
    --text-soft: rgba(255, 255, 255, 0.65);
    --text-hint: rgba(255, 255, 255, 0.35);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: rgba(245, 166, 35, 0.5);
    --error: #FF6B6B;
    --success: #69F0AE;
    --card-bg: rgba(17, 34, 64, 0.85);
    --radius: 16px;
    --radius-sm: 10px;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--sky-deep);
    color: var(--text-bright);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ── BACKGROUND ── */
.bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(175deg, #0a1628 0%, #0e1f42 40%, #152c5a 70%, #1a3760 100%);
    overflow: hidden;
    z-index: 0;
}

/* Sun disc */
.sun {
    position: absolute;
    bottom: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #FFE082, #F5A623 45%, #E65100 80%, #BF360C);
    box-shadow:
        0 0 60px 20px rgba(245, 166, 35, 0.35),
        0 0 120px 40px rgba(245, 166, 35, 0.15),
        0 0 200px 80px rgba(245, 100, 10, 0.08);
    animation: sunrise 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes sunrise {
    from {
        transform: translateX(-50%) translateY(60px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Horizon glow */
.horizon-glow {
    position: absolute;
    bottom: 37%;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top,
            rgba(240, 122, 26, 0.22) 0%,
            rgba(245, 166, 35, 0.08) 50%,
            transparent 100%);
    filter: blur(8px);
}

/* Rays */
.rays {
    position: absolute;
    bottom: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    animation: spinSlow 30s linear infinite;
    opacity: 0.07;
}

.ray {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 280px;
    background: linear-gradient(to top, rgba(245, 166, 35, 0.9), transparent);
    transform-origin: bottom center;
}

@keyframes spinSlow {
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

/* Stars */
.stars {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
    0%, 100% {
        opacity: var(--min-op, 0.3);
    }

    50% {
        opacity: 1;
    }
}

/* Horizon line */
.horizon-line {
    position: absolute;
    bottom: 37%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%, rgba(245, 166, 35, 0.4) 30%,
            rgba(255, 224, 102, 0.6) 50%,
            rgba(245, 166, 35, 0.4) 70%, transparent 100%);
}

/* Hills */
.hills {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38%;
}

.hill {
    position: absolute;
    bottom: 0;
    border-radius: 50% 50% 0 0;
}

.hill-back {
    left: -10%;
    width: 70%;
    height: 90%;
    background: linear-gradient(to top, #0a1628 60%, #0e1f42);
    opacity: 0.9;
}

.hill-mid {
    right: -5%;
    width: 65%;
    height: 80%;
    background: linear-gradient(to top, #0a1628 60%, #0d1c38);
    opacity: 0.95;
}

.hill-front {
    left: 20%;
    width: 60%;
    height: 55%;
    background: linear-gradient(to top, #0a1628, #0c1a30);
}

/* ── MAIN LAYOUT ── */
.page {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── HEADER (top brand) ── */
.brand-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 52px 24px 0;
    text-align: center;
    animation: fadeDown 0.8s 0.3s both;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.25);
    border-radius: 40px;
    padding: 6px 16px 6px 10px;
    margin-bottom: 14px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sun-gold);
    box-shadow: 0 0 8px var(--sun-gold);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.badge-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sun-gold);
}

.brand-name {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-bright);
    text-shadow: 0 2px 20px rgba(245, 166, 35, 0.3);
}

.brand-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-soft);
    letter-spacing: 0.04em;
}

/* ── LOGIN CARD ── */
.card-wrap {
    width: 100%;
    max-width: 420px;
    padding: 0 16px 28px;
    animation: slideUp 0.7s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.5),
        0 0 0 0.5px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.card-title {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-soft);
    margin-bottom: 24px;
}

/* ── FORM ELEMENTS ── */
.field {
    margin-bottom: 14px;
}

.field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 7px;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.5;
    pointer-events: none;
}

.input-icon svg {
    width: 100%;
    height: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    height: 50px;
    padding: 0 44px 0 42px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--text-bright);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input::placeholder {
    color: var(--text-hint);
}

input:focus {
    border-color: var(--sun-gold);
    background: rgba(245, 166, 35, 0.06);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

input.error {
    border-color: var(--error);
}

.eye-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-hint);
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.eye-btn:active {
    color: var(--text-soft);
}

.error-msg {
    display: none;
    font-size: 11.5px;
    color: var(--error);
    margin-top: 5px;
    padding-left: 2px;
}

.error-msg.show {
    display: block;
}

/* Role selector tabs */
.role-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 20px;
    gap: 3px;
}

.role-tab {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    color: var(--text-soft);
    background: transparent;
    -webkit-tap-highlight-color: transparent;
}

.role-tab.active {
    background: var(--sun-gold);
    color: #1a1000;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.35);
}

/* Forgot password */
.forgot {
    text-align: right;
    margin-top: -6px;
    margin-bottom: 20px;
}

.forgot a {
    font-size: 12.5px;
    color: var(--sun-gold);
    text-decoration: none;
    opacity: 0.85;
}

.forgot a:active {
    opacity: 1;
}

/* Login button */
.btn-login {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--sun-gold) 0%, var(--sun-orange) 100%);
    color: #1a1000;
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(245, 166, 35, 0.35), 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.25);
}

.btn-login .shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    animation: shinePass 3s 1.5s ease-in-out infinite;
}

@keyframes shinePass {
    0% {
        left: -100%;
    }

    25% {
        left: 160%;
    }

    100% {
        left: 160%;
    }
}

/* Loading state */
.btn-login.loading .btn-text {
    opacity: 0;
}

.btn-login.loading .btn-spinner {
    opacity: 1;
}

.btn-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.spinner-ring {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(26, 16, 0, 0.3);
    border-top-color: #1a1000;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--input-border);
}

.divider-text {
    font-size: 11px;
    color: var(--text-hint);
    white-space: nowrap;
}

/* WhatsApp OTP button */
.btn-wa {
    width: 100%;
    height: 46px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-wa:active {
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.4);
}

.wa-icon {
    width: 20px;
    height: 20px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-icon svg {
    width: 12px;
    height: 12px;
    fill: white;
}

/* Footer note */
.card-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-hint);
    line-height: 1.6;
}

.card-footer strong {
    color: var(--text-soft);
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 34, 64, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 10px 20px;
    font-size: 13px;
    color: var(--text-soft);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    white-space: nowrap;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    color: var(--success);
    border-color: rgba(105, 240, 174, 0.2);
}

.toast.error {
    color: var(--error);
    border-color: rgba(255, 107, 107, 0.2);
}

/* Status bar spacer for WebView */
.status-spacer {
    height: env(safe-area-inset-top, 20px);
}

.mb-4 {
    margin-bottom: 19px;
}

.logo img {
    width: 108px;
    margin: 0px auto;
    display: block;
    margin-bottom: 25px;
}