/* ==================== AUTH MODAL OVERLAY ==================== */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: authOverlayIn 0.2s ease-out;
}

@keyframes authOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    background: linear-gradient(165deg, #12141f 0%, #0d0f18 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.05);
    animation: authModalIn 0.25s ease-out;
}

@keyframes authModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.15s;
}

.auth-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* ==================== AUTH VIEW (inner content) ==================== */
.auth-view {
    text-align: center;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.auth-subtitle strong {
    color: var(--accent-blue);
    -webkit-text-fill-color: var(--accent-blue);
}

/* ==================== FORM ==================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.auth-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-field input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1);
}

.auth-field input::placeholder {
    color: #555;
}

.auth-field input:disabled {
    opacity: 0.5;
}

/* ==================== BUTTONS ==================== */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    border: none;
}

.auth-btn-primary:hover:not(:disabled) {
    filter: brightness(1.15);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}

.auth-btn-external {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    flex: 1;
}

.auth-btn-external:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.auth-external-icon {
    font-size: 1.1rem;
}

.auth-link-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-link-btn:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==================== SPINNER ==================== */
.auth-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* ==================== DIVIDER ==================== */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: #555;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ==================== EXTERNAL LOGIN ROW ==================== */
.auth-external {
    display: flex;
    gap: 0.75rem;
}

/* ==================== SWITCH (bottom link) ==================== */
.auth-switch {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==================== ERROR / SUCCESS ==================== */
.auth-error {
    background: rgba(255, 0, 51, 0.08);
    border: 1px solid rgba(255, 0, 51, 0.25);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
    text-align: left;
}

.auth-error p {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin: 0.125rem 0;
}

.auth-success {
    background: rgba(0, 255, 157, 0.08);
    border: 1px solid rgba(0, 255, 157, 0.25);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
}

.auth-success p {
    color: var(--accent-green);
    font-size: 0.85rem;
    margin: 0;
}

/* ==================== OTP CODE INPUT ==================== */
.code-input-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
}

.code-digit {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.5rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    caret-color: var(--accent-blue);
}

.code-digit:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
    background: rgba(0, 212, 255, 0.04);
}

.code-digit-error {
    border-color: var(--accent-red) !important;
    animation: codeShake 0.3s ease-in-out;
}

@keyframes codeShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.code-digit:disabled {
    opacity: 0.4;
}

.auth-resend {
    text-align: center;
    margin-top: 0.25rem;
}

.auth-resend-timer {
    font-size: 0.8rem;
    color: #555;
}

/* ==================== USER MENU (NAV BAR) ==================== */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chevron {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: #12141f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: authModalIn 0.15s ease-out;
    z-index: 100;
}

.user-dropdown-header {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.user-dropdown-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.user-dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0.25rem 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    background: none;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ==================== SIGN IN NAV BUTTON ==================== */
.nav-btn-signin {
    background: none;
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-btn-signin:hover {
    background-color: rgba(0, 212, 255, 0.1);
    color: #fff;
}
