/* ==============================
   AUTH PAGES — Radical Redesign
   Full-dark glassmorphism with animated gradient mesh
   ============================== */

/* --- Animated Background --- */
.auth-scene {
    min-height: 100vh;
    background: #1a1f2e;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* Animated mesh gradient */
.auth-scene::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: meshMove 20s ease-in-out infinite alternate;
}

@keyframes meshMove {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-5%, 3%) scale(1.05); }
    66%  { transform: translate(3%, -5%) scale(0.98); }
    100% { transform: translate(-2%, 2%) scale(1.02); }
}

/* Floating orbs */
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    will-change: transform;
}

.auth-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.2);
    top: -10%;
    right: -5%;
    animation: orbFloat1 15s ease-in-out infinite;
}

.auth-orb-2 {
    width: 350px;
    height: 350px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -10%;
    left: -5%;
    animation: orbFloat2 18s ease-in-out infinite;
}

.auth-orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(6, 182, 212, 0.12);
    top: 40%;
    left: 30%;
    animation: orbFloat3 22s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-40px, 60px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(50px, -40px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(0, 0); }
    33%      { transform: translate(30px, -50px); }
    66%      { transform: translate(-40px, 20px); }
}

/* --- Grid lines (subtle) --- */
.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
}

/* --- Glass Card --- */
.auth-glass {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(59, 130, 246, 0.05);
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-glass.auth-glass-wide {
    max-width: 600px;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Glow line at top of card */
.auth-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.4), transparent);
}

/* --- Logo --- */
.auth-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-logo img {
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.2));
}

/* --- Typography --- */
.auth-title {
    text-align: center;
    margin-bottom: 0.25rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    text-align: center;
    color: rgba(148, 163, 184, 0.7);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* --- Form Inputs (glass style) --- */
.auth-glass .form-control,
.auth-glass .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #f1f5f9;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    height: auto;
}

.auth-glass .form-control::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.auth-glass .form-control:focus,
.auth-glass .form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.05);
    color: #ffffff;
    outline: none;
}

.auth-glass .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.auth-glass .form-select option {
    background: #1e293b;
    color: #f1f5f9;
}

.auth-glass .form-floating > .form-control {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: #f1f5f9;
    height: 3.25rem;
    padding-top: 1.5rem;
}

.auth-glass .form-floating > .form-control:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.05);
    color: #ffffff;
}

.auth-glass .form-floating > .form-control::placeholder {
    color: transparent;
}

.auth-glass .form-floating > label {
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.875rem;
}

.auth-glass .form-floating > .form-control:focus ~ label,
.auth-glass .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: rgba(148, 163, 184, 0.8);
}

.auth-glass .form-label {
    color: rgba(148, 163, 184, 0.8);
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.auth-glass .text-danger {
    color: #f87171 !important;
    font-size: 0.8rem;
}

/* --- Primary Button (glowing) --- */
.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.5);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Shimmer sweep */
.auth-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.auth-btn-primary:hover::after {
    left: 100%;
}

/* --- Secondary / Outline Button --- */
.auth-btn-outline {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.auth-btn-outline:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* --- Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgba(148, 163, 184, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
}

/* --- Footer Link --- */
.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.8125rem;
    color: rgba(148, 163, 184, 0.5);
}

.auth-footer a {
    color: #60a5fa;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* --- Decorative SVG at bottom --- */
.auth-court-deco {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 90vw;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* --- Mobile adjustments --- */
@media (max-width: 575.98px) {
    .auth-scene {
        padding: 1rem 0.75rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .auth-glass {
        padding: 2rem 1.5rem;
        border-radius: 1rem;
    }

    .auth-glass.auth-glass-wide {
        padding: 1.75rem 1.25rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-logo img {
        height: 50px;
    }
}

/* --- Register-specific row spacing on mobile --- */
@media (max-width: 767.98px) {
    .auth-glass .row > [class*="col-"] + [class*="col-"] {
        margin-top: 0.75rem;
    }
    .auth-glass .row.mb-3 > .col-md-6.mt-3 {
        margin-top: 0.75rem !important;
    }
}

/* --- Intl-tel-input dark override --- */
.auth-glass .iti--separate-dial-code .iti__selected-dial-code {
    color: #94a3b8;
}

.auth-glass .iti__country-list {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

.auth-glass .iti__country-list .iti__country:hover {
    background: rgba(255, 255, 255, 0.05);
}

.auth-glass .iti__country-list .iti__country-name,
.auth-glass .iti__country-list .iti__dial-code {
    color: #e2e8f0;
}
