/* ============================================
   POKER ANALYZER - AUTH PAGE STYLES
   Sign in, register, account management
   ============================================ */

/* ============================================
   AUTH LAYOUT
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + var(--space-12)) var(--space-6) var(--space-12);
    background: var(--gradient-felt-linear);
    position: relative;
}

.auth-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================
   AUTH CONTAINER (the card)
   ============================================ */
.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-header .auth-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: var(--space-6);
}

.auth-header .auth-logo .logo-icon {
    color: var(--gold-primary);
    font-size: 1.3em;
}

.auth-header .auth-logo .logo-accent {
    color: var(--gold-primary);
}

.auth-header h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

/* ============================================
   AUTH FORM
   ============================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.auth-field label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

.auth-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.auth-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.auth-input.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Password field with toggle */
.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: var(--space-12);
}

.auth-password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.auth-password-toggle:hover {
    color: var(--text-primary);
}

/* ============================================
   FIELD EXTRAS (forgot password link, etc.)
   ============================================ */
.auth-field-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--space-1) * -1);
}

.auth-field-extras a {
    font-size: var(--text-sm);
    color: var(--gold-primary);
}

.auth-field-extras a:hover {
    color: var(--gold-light);
}

/* ============================================
   AUTH BUTTON
   ============================================ */
.auth-submit {
    width: 100%;
    padding: var(--space-3) var(--space-6);
    background: var(--gradient-gold);
    color: var(--text-inverse);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-gold);
    margin-top: var(--space-2);
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-gold);
}

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

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.auth-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.auth-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: var(--text-inverse);
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MESSAGES (error / success)
   ============================================ */
.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    display: none;
}

.auth-success.visible {
    display: block;
}

.auth-field-error {
    color: #fca5a5;
    font-size: var(--text-xs);
    margin-top: var(--space-1);
    display: none;
}

.auth-field-error.visible {
    display: block;
}

/* ============================================
   AUTH FOOTER (links below form)
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--gold-primary);
    font-weight: var(--font-medium);
}

.auth-footer a:hover {
    color: var(--gold-light);
}

/* ============================================
   DIVIDER (for future OAuth)
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ============================================
   ACCOUNT PAGE
   ============================================ */
.account-section {
    padding: calc(var(--nav-height) + var(--space-10)) var(--space-6) var(--space-12);
    min-height: 100vh;
}

.account-container {
    max-width: 640px;
    margin: 0 auto;
}

.account-header {
    margin-bottom: var(--space-8);
}

.account-header h1 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.account-header p {
    color: var(--text-secondary);
}

.account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
}

.account-card h2 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

/* Profile info rows */
.account-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
}

.account-info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.account-info-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.account-info-value {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.account-plan-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-full);
    color: var(--gold-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Danger zone */
.account-card.danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.account-card.danger h2 {
    color: var(--color-danger);
    border-bottom-color: rgba(239, 68, 68, 0.2);
}

.auth-btn-danger {
    padding: var(--space-3) var(--space-6);
    background: transparent;
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
}

/* ============================================
   NAV USER DROPDOWN (logged-in state)
   ============================================ */
.nav-user-menu {
    position: relative;
}

.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.nav-user-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient-gold);
    color: var(--text-inverse);
    border-radius: 50%;
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
}

.nav-user-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 180px;
    padding: var(--space-2);
    background: rgba(13, 8, 8, 0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    display: none;
    flex-direction: column;
    gap: var(--space-1);
    z-index: var(--z-dropdown);
}

.nav-user-dropdown.open {
    display: flex;
}

.nav-user-dropdown a,
.nav-user-dropdown button {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    font: inherit;
}

.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover {
    background: rgba(212, 175, 55, 0.12);
    color: var(--text-primary);
}

@media (max-width: 991px) {
    .nav-user-email {
        display: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .auth-section {
        padding: calc(var(--nav-height) + var(--space-6)) var(--space-4) var(--space-8);
    }

    .auth-card {
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    .auth-header h1 {
        font-size: var(--text-xl);
    }

    .account-section {
        padding: calc(var(--nav-height) + var(--space-6)) var(--space-4) var(--space-8);
    }

    .account-card {
        padding: var(--space-6);
    }

    .account-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }
}

@media (max-width: 479px) {
    .auth-card {
        padding: var(--space-5);
    }

    .account-card {
        padding: var(--space-5);
    }
}
