@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-body: #2c1c72;
    --bg-app: #1c1260;
    --bg-app-top: #251a70;
    --bg-app-bottom: #141050;
    --card-purple-1: #2a1c85;
    --card-purple-2: #3a28a8;
    --card-purple-3: #4e38c2;
    --nav-active: #6040d0;
    --green: #22c55e;
    --red: #ef4444;
    --white: #ffffff;
    --light: rgba(255, 255, 255, 0.7);
    --dim: rgba(255, 255, 255, 0.4);
    --font: 'Inter', -apple-system, sans-serif;
    --border: rgba(70, 50, 150, 0.3);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 25%, #3825a0 0%, #2c1c72 45%, #1a1050 100%);
    z-index: -1;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    min-height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(178deg, var(--bg-app-top) 0%, var(--bg-app) 30%, var(--bg-app-bottom) 100%);
    border-radius: 30px;
    padding: 40px 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 3px 0 rgba(140, 110, 255, 0.3), inset 3px 0 0 rgba(140, 110, 255, 0.15),
        inset 0 -3px 0 rgba(0, 0, 0, 0.4), inset -3px 0 0 rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(100, 75, 210, 0.25);
}

/* 3D Back Button */
.auth-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 10px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(30, 22, 80, 0.95), rgba(18, 14, 60, 0.95));
    border: 1.5px solid rgba(100, 80, 200, 0.3);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4),
        inset 0 2px 3px rgba(140, 120, 255, 0.15),
        inset 0 -2px 3px rgba(0, 0, 0, 0.2);
    color: var(--white);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 28px;
    align-self: flex-start;
}

.auth-back-btn:hover {
    transform: translateX(-4px) scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 2px 3px rgba(140, 120, 255, 0.2),
        inset 0 -2px 3px rgba(0, 0, 0, 0.2);
    border-color: rgba(120, 100, 240, 0.45);
}

.auth-back-btn:active {
    transform: translateX(-2px) scale(0.96);
}

.back-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: radial-gradient(circle at 35% 28%, #7c5cf0, #5535c8 60%, #3a20a0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--white);
    box-shadow: 0 4px 12px rgba(90, 50, 200, 0.4),
        inset 0 2px 4px rgba(200, 180, 255, 0.25),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-back-btn:hover .back-btn-icon {
    transform: translateX(-2px);
}

/* Brand */
.auth-brand {
    text-align: center;
    margin-bottom: 36px;
}

/* 3D Globe Logo for Auth Pages */
.auth-logo-globe {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-globe-sphere {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #4a8cf5, #2a5cc0 40%, #1a3a88 70%, #102050 100%);
    position: relative;
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5), inset 0 3px 6px rgba(140, 180, 255, .25), inset 0 -4px 8px rgba(0, 0, 0, .4);
    border: 1.5px solid rgba(100, 160, 255, .2);
}

.auth-globe-lines {
    position: absolute;
    inset: 0;
    animation: authGlobeRotate 6s linear infinite;
}

.auth-meridian {
    position: absolute;
    top: 2px;
    bottom: 2px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-radius: 50%;
}

.auth-meridian.am1 {
    left: 14px;
    width: 44px;
}

.auth-meridian.am2 {
    left: -8px;
    width: 44px;
}

.auth-meridian.am3 {
    left: 36px;
    width: 44px;
}

.auth-meridian.am4 {
    left: -30px;
    width: 44px;
}

.auth-meridian.am5 {
    left: 58px;
    width: 44px;
}

.auth-equator {
    position: absolute;
    left: 3px;
    right: 3px;
    height: 0;
    border-top: 1.5px solid rgba(255, 255, 255, .18);
    z-index: 3;
}

.auth-equator.aeq1 {
    top: 50%;
}

.auth-equator.aeq2 {
    top: 32%;
}

.auth-equator.aeq3 {
    top: 68%;
}

.auth-globe-highlight {
    position: absolute;
    top: 5px;
    left: 8px;
    width: 28px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, .3) 0%, transparent 70%);
    z-index: 5;
    pointer-events: none;
}

.auth-globe-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 140, 245, .3) 0%, rgba(42, 92, 192, .1) 50%, transparent 70%);
    animation: authGlowPulse 3s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes authGlobeRotate {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50px);
    }
}

@keyframes authGlowPulse {

    0%,
    100% {
        opacity: .5;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.12);
    }
}

/* 3D Title Text */
.auth-title-3d {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    margin-bottom: 6px;
}

.at-line1 {
    font-size: 1.7rem;
    font-weight: 900;
    padding-left: 4px;
    color: #f5c842;
    text-shadow: 0 1px 0 rgba(180, 130, 20, .6), 0 2px 0 rgba(120, 80, 10, .4), 0 3px 8px rgba(0, 0, 0, .5);
}

.at-line2 {
    font-size: 1.7rem;
    font-weight: 900;
    color: #d4d0ff;
    text-shadow: 0 1px 0 rgba(100, 80, 200, .5), 0 2px 0 rgba(60, 40, 140, .35), 0 3px 8px rgba(0, 0, 0, .5);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--dim);
    margin-top: 4px;
}

/* Alerts */
.auth-alert {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.auth-alert.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.auth-alert.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

/* Form */
.auth-group {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--light);
    margin-bottom: 8px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap i.auth-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--dim);
    z-index: 2;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    padding: 15px 16px 15px 50px;
    background: rgba(20, 14, 62, 0.85);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    color: var(--white);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    transition: all 0.25s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.auth-input::placeholder {
    color: var(--dim);
}

.auth-input:focus {
    border-color: #6040d0;
    box-shadow: 0 0 0 3px rgba(96, 64, 208, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-input:focus~.auth-icon {
    color: #a78bfa;
}

.toggle-pass {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dim);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 2;
}

/* Submit Button */
.auth-submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #7550e0, #5c3cc0);
    color: white;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(90, 55, 200, 0.4), inset 0 2px 4px rgba(180, 160, 255, 0.2), inset 0 -2px 4px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(90, 55, 200, 0.5);
}

.auth-submit:active {
    transform: scale(0.97);
}

.auth-submit .btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%
    }

    50% {
        left: 100%
    }

    100% {
        left: 100%
    }
}

/* Footer link */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--dim);
}

.auth-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 700;
}

.auth-footer a:hover {
    color: #c4b5fd;
}

/* Responsive */
@media (max-width:430px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .auth-container {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* ====== 3D POPUP LOADER OVERLAY ====== */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 6, 40, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: loaderFadeIn 0.3s ease-out;
}
.loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 36px 44px;
    border-radius: 24px;
    background: linear-gradient(178deg, rgba(30, 24, 85, 0.95) 0%, rgba(20, 16, 65, 0.95) 100%);
    border: 1.5px solid rgba(100, 80, 200, 0.25);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 2px 0 rgba(140, 110, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    animation: loaderPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.loader-spinner {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 4px solid rgba(120, 90, 255, 0.15);
    border-top: 4px solid #a78bfa;
    border-right: 4px solid rgba(167, 139, 250, 0.5);
    animation: loaderSpin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3), inset 0 0 12px rgba(167, 139, 250, 0.1);
}
.loader-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}
.loader-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: -10px;
}
@keyframes loaderFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes loaderPopIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}