/* ==========================================================================
   GLAZENIQ - Awwwards-Level Authentication CSS System
   Cinematic Glassmorphism, Floating Labels, Tab Morphing & Particle Backdrop
   ========================================================================== */

/* 1. Page Base & Ambient Stage Layout */
.auth-page-body {
    background-color: var(--bg-color, #070709);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

#auth-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background-color: #070709;
}

.auth-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 40%, transparent 20%, rgba(7, 7, 9, 0.85) 80%, #070709 100%);
}

.auth-stage {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 60px;
    width: 100%;
}

/* 2. Glassmorphic Card Container */
.auth-card-backdrop {
    position: absolute;
    width: 520px;
    height: 640px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, rgba(52, 211, 153, 0.08) 40%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    animation: ambientPulse 8s infinite alternate ease-in-out;
}

@keyframes ambientPulse {
    0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: rgba(14, 14, 18, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 40px 36px;
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 1px rgba(255, 255, 255, 0.2) inset;
    animation: authCardEnter 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authCardEnter {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3. Card Header & Typography */
.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card-header .brand-pill {
    margin-bottom: 14px;
}

.auth-main-title {
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-heading, #ffffff);
    margin-bottom: 8px;
    text-transform: uppercase;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.auth-main-subtitle {
    font-size: 0.84rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
    transition: opacity 0.3s ease;
}

/* 4. Tab Switcher Navigation */
.auth-tabs {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 4px;
    margin-bottom: 32px;
}

.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.tab-btn {
    flex: 1;
    position: relative;
    z-index: 2;
    padding: 10px 0;
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
    text-align: center;
}

.tab-btn.active {
    color: var(--text-heading, #ffffff);
}

.tab-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.7);
}

/* 5. Viewport Slider & Form Panes */
.auth-forms-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.auth-forms-track {
    display: flex;
    width: 200%;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-forms-track.show-login {
    transform: translateX(0%);
}

.auth-forms-track.show-signup {
    transform: translateX(-50%);
}

.auth-form-pane {
    width: 50%;
    padding: 0 4px;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.4s ease 0.1s;
}

.auth-forms-track.show-login .pane-login,
.auth-forms-track.show-signup .pane-signup {
    opacity: 1;
    pointer-events: auto;
}

/* 6. Social Auth Grid */
.social-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-heading, #ffffff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

/* 7. Divider Line */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0 28px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: rgba(14, 14, 18, 0.95);
    padding: 0 14px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-muted, rgba(255, 255, 255, 0.35));
    text-transform: uppercase;
}

/* 8. Floating Label Form Inputs */
.input-group {
    position: relative;
    margin-bottom: 22px;
}

.floating-input {
    width: 100%;
    height: 52px;
    padding: 18px 16px 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.92rem;
    color: #ffffff;
    outline: none;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.floating-label {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), font-size 0.25s ease, color 0.25s ease;
}

/* Floating label trigger when focused or not empty */
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    transform: translateY(-10px);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
}

.floating-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.08);
}

.input-group.has-error .floating-input {
    border-color: #f87171 !important;
    background: rgba(248, 113, 113, 0.05) !important;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.15) !important;
}

.error-msg {
    display: none;
    font-size: 0.72rem;
    color: #f87171;
    margin-top: 6px;
    padding-left: 4px;
    animation: fadeIn 0.25s ease;
}

.input-group.has-error .error-msg {
    display: block;
}

/* Password Toggle Eye Button */
.btn-toggle-password {
    position: absolute;
    right: 14px;
    top: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease;
}

.btn-toggle-password:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* 9. Password Strength Meter */
.strength-meter-wrap {
    margin-top: 10px;
    padding: 0 2px;
    display: none;
}

.strength-meter-wrap.is-visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.strength-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-bar-fill {
    width: 0%;
    height: 100%;
    background: #f87171;
    border-radius: 4px;
    transition: width 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.strength-text-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.strength-label {
    color: rgba(255, 255, 255, 0.4);
}

.strength-value {
    font-weight: 700;
    color: #f87171;
    transition: color 0.35s ease;
}

.confirm-match-badge {
    position: absolute;
    right: 16px;
    top: 18px;
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* 10. Checkboxes & Utilities */
.form-utility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    font-size: 0.8rem;
}

.custom-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: rgba(255, 255, 255, 0.6);
}

.custom-checkbox-wrap input[type="checkbox"] {
    display: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.25s ease;
}

.custom-checkbox-wrap input[type="checkbox"]:checked + .custom-checkbox {
    background: #ffffff;
    border-color: #ffffff;
    color: #070709;
}

.checkbox-label {
    font-size: 0.78rem;
    line-height: 1.4;
}

.link-forgot, .inline-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.link-forgot:hover, .inline-link:hover {
    color: #ffffff;
}

/* 11. Luxury Auth Submit Button */
.btn-auth-submit {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #ffffff;
    color: #070709;
    border: none;
    border-radius: 10px;
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(255, 255, 255, 0.15);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn-auth-submit:hover {
    background: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.25);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.btn-auth-submit .btn-arrow {
    transition: transform 0.25s ease;
}

.btn-auth-submit:hover .btn-arrow {
    transform: translateX(4px);
}

/* Loading Spinner for Submit Button */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(7, 7, 9, 0.2);
    border-top-color: #070709;
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 12. Card Footer & Security Badge */
.auth-card-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
}

/* 13. Header Auth Buttons & User Profile Account Menu */
.btn-auth-link {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-heading, #ffffff);
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.btn-auth-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-account-menu {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #34d399;
    border: 2px solid #070709;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 260px;
    background: rgba(14, 14, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1000;
}

.user-account-menu.is-active .account-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    padding-bottom: 12px;
}

.user-display-name {
    font-family: var(--font-heading, 'Syne', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.user-display-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

.dropdown-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.badge-status {
    color: #34d399;
    font-size: 0.7rem;
    margin-left: auto;
}

.btn-signout {
    color: #f87171;
}

.btn-signout:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
}

/* 14. Floating Toast System */
.auth-toast-container {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.auth-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(18, 18, 22, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(16px);
    color: #ffffff;
    font-size: 0.84rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    0% { opacity: 0; transform: translateX(50px) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

.auth-toast.toast-success {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.15);
}

.auth-toast.toast-error {
    border-color: rgba(248, 113, 113, 0.4);
    box-shadow: 0 10px 30px rgba(248, 113, 113, 0.15);
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.toast-error .toast-icon {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* Responsive Media Queries */

/* Tablet (≤768px) */
@media (max-width: 768px) {
    .auth-stage {
        padding: 90px 20px 40px;
        align-items: flex-start;
    }
    .auth-card {
        max-width: 100%;
    }
    .auth-card-backdrop {
        display: none; /* hide heavy blur glow on mobile for perf */
    }
}

/* Small Mobile (≤600px) */
@media (max-width: 600px) {
    .auth-card {
        padding: 32px 20px;
        border-radius: 18px;
    }
    
    .auth-main-title {
        font-size: 1.4rem;
    }

    .social-auth-grid {
        grid-template-columns: 1fr;
    }

    .auth-toast-container {
        right: 16px;
        left: 16px;
        top: 90px;
    }
}

/* Extra-Small Mobile (≤400px) */
@media (max-width: 400px) {
    .auth-stage {
        padding: 80px 14px 40px;
    }
    .auth-card {
        padding: 28px 16px;
        border-radius: 14px;
    }
    .auth-main-title {
        font-size: 1.2rem;
    }
    .floating-input {
        height: 50px;
    }
    .btn-auth-submit {
        height: 48px;
        font-size: 0.82rem;
    }
}

