/* ═══════════════════════════════════════════════
   Shared auth styles for login.html and signup.html
   Tokens, reset, .btn come from components.css
   ═══════════════════════════════════════════════ */

body.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(187, 134, 252, 0.12) 0%, transparent 30%),
        radial-gradient(circle at 86% 18%, rgba(3, 218, 198, 0.08) 0%, transparent 25%),
        linear-gradient(180deg, #040404 0%, #0a0a0f 40%, #050505 100%);
    color: var(--text-primary);
    overflow-x: hidden;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(circle at center, black 32%, transparent 86%);
    -webkit-mask-image: radial-gradient(circle at center, black 32%, transparent 86%);
    opacity: 0.45;
    z-index: 0;
}

.auth-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 3rem;
}

.auth-shell {
    position: relative;
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
    align-items: stretch;
}

/* ── Brand / benefits panel (left) ──────────── */
.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at 20% 0%, rgba(187, 134, 252, 0.2) 0%, transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(3, 218, 198, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, rgba(18, 18, 24, 0.9) 0%, rgba(8, 8, 12, 0.95) 100%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: var(--text-primary);
}

.auth-brand::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(5, 5, 10, 0.35) 100%);
    pointer-events: none;
    z-index: 0;
}

.auth-brand > * {
    position: relative;
    z-index: 1;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    width: fit-content;
}

.auth-brand-logo-icon {
    font-size: 1.7rem;
    filter: drop-shadow(0 2px 8px rgba(187, 134, 252, 0.5));
}

.auth-brand-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #e2c6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-brand-kicker {
    display: inline-flex;
    width: fit-content;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-pill);
    background: rgba(187, 134, 252, 0.15);
    border: 1px solid rgba(187, 134, 252, 0.3);
    color: #e2c6ff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-brand-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.auth-brand-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 44ch;
}

.auth-brand-points {
    list-style: none;
    display: grid;
    gap: 0.75rem;
    margin-top: auto;
}

.auth-brand-point {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.auth-brand-point-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(187, 134, 252, 0.18);
    color: #e2c6ff;
}

.auth-brand-point strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.auth-brand-point span {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ── Form card (right) ──────────────────────── */
.auth-container {
    display: flex;
    align-items: center;
}

.auth-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%),
        var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    animation: authFadeInUp 0.6s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: authBounce 2.4s ease-in-out infinite;
}

.auth-header h2 {
    font-size: 1.78rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-alt {
    display: grid;
    gap: 0;
    margin-bottom: 1rem;
}

.btn-provider {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 0.9rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease,
                background 0.3s ease;
}

.btn-provider:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.07);
}

.btn-provider:disabled,
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-flux {
    background: linear-gradient(135deg, rgba(98, 0, 234, 0.22) 0%, rgba(3, 218, 198, 0.15) 100%);
}

.flux-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffffff 0%, #c6f7ff 100%);
    color: #130b25;
    font-weight: 800;
    flex-shrink: 0;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin-bottom: 1rem;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 0.85rem;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

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

.auth-form .form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-form .form-group input {
    width: 100%;
    padding: 0.92rem 0.98rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.97rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.14);
}

.auth-form .form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 3.1rem;
}

.password-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.password-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.password-toggle .eye-off {
    display: none;
}

.password-toggle.is-visible .eye-on {
    display: none;
}

.password-toggle.is-visible .eye-off {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn-submit {
    width: 100%;
    min-height: 50px;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 0.15rem;
    box-shadow: var(--shadow-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.auth-footer {
    text-align: center;
    margin-top: 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ── Messages ──────────────────────────────── */
.error-message,
.success-message {
    display: none;
    padding: 0.9rem 0.95rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
    font-weight: 500;
    animation: authSlideDown 0.3s ease;
}

.error-message.is-visible,
.success-message.is-visible {
    display: block;
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff6b6b;
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4caf50;
}

/* ── Animations ────────────────────────────── */
@keyframes authSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes authBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 460px;
        gap: 1.5rem;
    }

    .auth-brand {
        padding: 1.75rem;
        gap: 1rem;
    }

    .auth-brand-points {
        display: none;
    }

    .auth-main {
        padding: 5rem 1.25rem 2.5rem;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 5.25rem 1rem 2rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-brand {
        padding: 1.4rem;
        border-radius: var(--radius-lg);
    }

    .auth-header h2 {
        font-size: 1.55rem;
    }

    .auth-icon {
        font-size: 2.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-icon,
    .auth-card,
    .error-message,
    .success-message {
        animation: none;
    }

    .btn-provider,
    .btn-submit {
        transition: none;
    }
}
