/* Auth Styles - Clean Modern Dark Theme for Enhance Agility
   Deep navy background, gradient-bordered card, purple + blue accents */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --auth-font: 'Sora', system-ui, -apple-system, sans-serif;
    --auth-bg: #0b0f1a;
    --auth-surface: #111827;
    --auth-surface-light: #1a2234;
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-border-bright: rgba(255, 255, 255, 0.15);
    --auth-text: #e8ecf4;
    --auth-text-dim: #8892a8;
    --auth-text-muted: #6b7280;
    --auth-primary: #3b82f6;
    --auth-primary-hover: #2563eb;
    --auth-purple: #7c3aed;
    --auth-purple-light: #a78bfa;
    --auth-input-bg: #1a2234;
    --auth-input-border: rgba(255, 255, 255, 0.1);
    --auth-input-focus: #3b82f6;
    --auth-btn-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --auth-card-border: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

/* ============================================
   BASE / BODY
   ============================================ */
.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--auth-bg);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(124, 58, 237, 0.04) 0%, transparent 50%);
    font-family: var(--auth-font);
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

/* ============================================
   CARD
   ============================================ */
.auth-card {
    position: relative;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 80px -20px rgba(59, 130, 246, 0.06);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.75rem;
        border-radius: 1rem;
    }
}

/* ============================================
   BRAND ICON
   ============================================ */
.auth-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-purple) 0%, #6d28d9 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.auth-brand-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* ============================================
   HEADINGS
   ============================================ */
.auth-heading {
    font-size: 1.625rem;
    font-weight: 700;
    text-align: center;
    color: var(--auth-text);
    margin: 0 0 0.375rem;
    letter-spacing: -0.01em;
}

.auth-subheading {
    font-size: 0.875rem;
    text-align: center;
    color: var(--auth-text-dim);
    margin: 0 0 2rem;
    font-weight: 400;
}

/* ============================================
   FORM
   ============================================ */
.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

/* ============================================
   INPUTS
   ============================================ */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 0.875rem;
    color: var(--auth-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.auth-input-icon svg {
    width: 18px;
    height: 18px;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: 0.75rem;
    color: var(--auth-text);
    font-family: var(--auth-font);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.auth-input::placeholder {
    color: var(--auth-text-muted);
}

.auth-input:focus {
    border-color: var(--auth-input-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--auth-surface-light);
}

/* Password toggle positioned right */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    color: var(--auth-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.password-toggle:hover {
    color: var(--auth-text);
}

/* ============================================
   FORGOT PASSWORD LINK
   ============================================ */
.auth-forgot-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: var(--auth-purple-light);
}

/* ============================================
   REMEMBER ME CHECKBOX
   ============================================ */
.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox-wrapper input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-checkbox-wrapper label {
    font-size: 0.8125rem;
    color: var(--auth-text-dim);
    cursor: pointer;
}

/* ============================================
   PRIMARY BUTTON
   ============================================ */
.auth-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: var(--auth-btn-gradient);
    color: white;
    font-family: var(--auth-font);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.auth-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.auth-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.auth-btn-primary:disabled,
.auth-btn-primary.auth-btn-loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.auth-btn-primary svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   DIVIDER
   ============================================ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
    white-space: nowrap;
}

/* ============================================
   SOCIAL BUTTONS
   ============================================ */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--auth-surface-light);
    border: 1px solid var(--auth-border);
    border-radius: 0.75rem;
    color: var(--auth-text);
    font-family: var(--auth-font);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--auth-border-bright);
}

.social-btn img,
.social-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Social divider text */
.social-divider-text {
    background: var(--auth-surface) !important;
    color: var(--auth-text-muted) !important;
}

/* ============================================
   FOOTER LINK
   ============================================ */
.auth-footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-text-dim);
    margin-top: 1.75rem;
}

.auth-footer-text a {
    color: var(--auth-primary);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-footer-text a:hover {
    color: var(--auth-purple-light);
}

/* ============================================
   PASSWORDLESS OPTIONS
   ============================================ */
.auth-alt-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
}

.auth-alt-methods a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.auth-alt-methods a:hover {
    color: var(--auth-purple-light);
}

.auth-alt-methods .auth-separator {
    color: var(--auth-text-muted);
}

/* ============================================
   PASSKEY BUTTON
   ============================================ */
.auth-passkey-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 0.75rem;
    color: var(--auth-purple-light);
    font-family: var(--auth-font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.auth-passkey-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.35);
}

.auth-passkey-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   ALERTS / MESSAGES
   ============================================ */
.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.auth-alert-error ul {
    margin: 0.375rem 0 0;
    padding-left: 1.25rem;
}

.auth-alert-error li {
    margin-bottom: 0.125rem;
}

/* ============================================
   D20 SPINNER (kept for loading state)
   ============================================ */
.d20-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
    margin-left: -0.25rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card {
    animation: fadeIn 0.4s ease-out;
}

/* ============================================
   LANDING PAGE - APP CARDS
   ============================================ */
.landing-apps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.landing-app-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--auth-surface-light);
    border: 1px solid var(--auth-border);
    border-radius: 0.875rem;
    text-decoration: none;
    color: var(--auth-text);
    transition: all 0.2s ease;
}

.landing-app-card:hover {
    border-color: var(--auth-primary);
    background: rgba(59, 130, 246, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.landing-app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.landing-app-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 0.25rem;
}

.landing-app-icon svg {
    width: 22px;
    height: 22px;
    color: var(--auth-primary);
}

.landing-app-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.landing-app-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--auth-text);
    line-height: 1.3;
}

.landing-app-desc {
    font-size: 0.8125rem;
    color: var(--auth-text-dim);
    margin-top: 0.125rem;
    line-height: 1.3;
}

.landing-app-arrow {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--auth-text-muted);
    transition: color 0.2s ease, transform 0.2s ease;
}

.landing-app-card:hover .landing-app-arrow {
    color: var(--auth-primary);
    transform: translateX(2px);
}

/* ============================================
   HIDDEN UTILITY
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }
    .d20-spinner {
        animation-duration: 3s;
    }
}
