/* ============================================
   AUTH - Clean, Mobile-First
   ============================================ */

/* Hide all app chrome on auth pages */
body:has(.auth-page) .app-header,
body:has(.auth-page) .desktop-nav,
body:has(.auth-page) .bottom-nav,
body:has(.auth-page) .mobile-menu,
body:has(.auth-page) header,
body:has(.auth-page) nav {
    display: none !important;
}

body:has(.auth-page) {
    overscroll-behavior: none;
}

body:has(.auth-page) .page-content,
body:has(.auth-page) .app-main,
body:has(.auth-page) main {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

/* ============================================
   VARIABLES
   ============================================ */

.auth-page {
    --a-bg: #0a0a0a;
    --a-card: #141414;
    --a-text: #f0f0f0;
    --a-text2: #888;
    --a-border: #2a2a2a;
    --a-accent: #7c5cfc;
    --a-accent-hover: #6a4ce0;
    --a-error: #ef4444;
    --a-radius: 12px;
    --a-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
    .auth-page {
        --a-bg: #f5f5f7;
        --a-card: #ffffff;
        --a-text: #1a1a1a;
        --a-text2: #666;
        --a-border: #e0e0e0;
    }
}

/* ============================================
   LAYOUT
   ============================================ */

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--a-bg);
    font-family: var(--a-font);
    padding: 1rem;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--a-card);
    border: 1px solid var(--a-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
}

/* ============================================
   LOGO
   ============================================ */

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

/* ============================================
   TEXT
   ============================================ */

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--a-text);
    text-align: center;
    margin: 0 0 0.25rem;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--a-text2);
    text-align: center;
    margin: 0 0 1.75rem;
}

/* ============================================
   FORM
   ============================================ */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--a-text);
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 0.875rem;
    font-size: 1rem;
    font-family: var(--a-font);
    color: var(--a-text);
    background: var(--a-bg);
    border: 1.5px solid var(--a-border);
    border-radius: var(--a-radius);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.auth-input::placeholder {
    color: var(--a-text2);
    opacity: 0.5;
}

.auth-input:focus {
    border-color: var(--a-accent);
}

.auth-input.error {
    border-color: var(--a-error);
}

/* Password field */
.auth-pw {
    position: relative;
}

.auth-pw .auth-input {
    padding-right: 2.75rem;
}

.auth-pw-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--a-text2);
    display: flex;
    align-items: center;
    outline: none;
}

.auth-pw-toggle:hover {
    color: var(--a-text);
}

/* ============================================
   BUTTON
   ============================================ */

.auth-btn {
    width: 100%;
    height: 48px;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--a-font);
    color: #fff;
    background: var(--a-accent);
    border: none;
    border-radius: var(--a-radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-appearance: none;
}

.auth-btn:hover {
    background: var(--a-accent-hover);
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   ERROR
   ============================================ */

.auth-error {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--a-radius);
    color: var(--a-error);
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

/* ============================================
   LINKS
   ============================================ */

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
}

.auth-links span {
    color: var(--a-text2);
}

.auth-links a {
    color: var(--a-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* ============================================
   PASSWORD STRENGTH (register)
   ============================================ */

.pw-strength {
    height: 3px;
    background: var(--a-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.pw-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.pw-strength-fill.weak { width: 33%; background: var(--a-error); }
.pw-strength-fill.medium { width: 66%; background: #f59e0b; }
.pw-strength-fill.strong { width: 100%; background: #22c55e; }

.pw-hint {
    font-size: 0.75rem;
    color: var(--a-text2);
    margin-top: 0.35rem;
}

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 480px) {
    .auth-page {
        padding: 0;
        align-items: stretch;
    }

    .auth-card {
        max-width: 100%;
        border-radius: 0;
        border: none;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem 1.5rem;
        padding-top: calc(2rem + env(safe-area-inset-top, 0));
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0));
        box-sizing: border-box;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0.01ms !important; }
}
