/**
 * Auth modal + forms — used by the standalone landing page
 * (SPA also has these rules in style.css).
 */
:root {
    --bg-surface: rgba(15, 15, 23, 0.98);
    --bg-elevated: rgba(30, 30, 46, 0.85);
    --bg-primary: #0a0a0f;
    --radius-lg: 16px;
    --accent-hover: #a78bfa;
    --red-500: #ef4444;
    --green-500: #22c55e;
}

.auth-modal-overlay {
    z-index: 10300;
    backdrop-filter: blur(2px);
    background: rgba(30, 30, 46, 0.65);
}

.auth-modal-overlay .auth-modal {
    max-width: 440px;
    width: min(440px, calc(100vw - 2rem));
    max-height: min(92vh, 900px);
    overflow: auto;
    padding: 0;
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.auth-modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
}

.auth-modal-body,
.auth-modal-panel {
    padding: 2.25rem 1.5rem 1.75rem;
    box-sizing: border-box;
}

.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;
}

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

.auth-mode-tabs {
    display: flex;
    gap: 4px;
    width: 100%;
    margin: 0 0 1.25rem;
    padding: 4px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.auth-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 0.75rem;
    border: 1px solid transparent;
    border-radius: calc(var(--radius-md) - 2px);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-mode-tab:hover:not(.is-active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.auth-mode-tab.is-active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 1px 0 rgba(139, 92, 246, 0.12);
    cursor: default;
}

.auth-mode-tab:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 1px;
}

.auth-title {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-signup-hint {
    margin: -0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: left;
}

.auth-google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #fff;
    color: #181825;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.95rem 1.25rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    box-sizing: border-box;
}

.auth-google-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-1px);
    color: #181825;
}

.auth-google-btn img {
    width: 22px;
    height: 22px;
}

.auth-divider {
    margin: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 1.5rem);
    height: 1px;
    background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

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

.auth-input {
    width: 100%;
    padding: 1rem 1.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    min-height: 52px;
    line-height: 1.4;
    box-sizing: border-box;
    font-family: var(--font-sans);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.auth-password-field {
    position: relative;
}

.auth-password-field .auth-input {
    padding-right: 3.25rem;
}

.auth-eye-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(139, 92, 246, 0.75);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.auth-eye-btn .eye-open[hidden],
.auth-eye-btn .eye-closed[hidden] {
    display: none !important;
}

.auth-eye-btn:hover,
.auth-eye-btn[aria-pressed="true"] {
    color: var(--accent);
    background: rgba(139, 92, 246, 0.12);
}

.auth-submit {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.95rem 1.25rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.auth-submit:disabled,
.auth-resend-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: -0.25rem;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

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

.auth-remember .checkbox-wrapper {
    flex-shrink: 0;
}

.auth-remember-label {
    line-height: 1.2;
}

.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border-hover);
    border-radius: 4px;
    transition: all var(--transition-fast);
    position: relative;
    background: transparent;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform var(--transition-fast);
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.auth-form + .auth-divider {
    margin-top: 1.25rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-500);
}

.auth-alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--green-500);
}

.auth-verify-lead {
    margin: 0 0 0.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-resend-btn {
    width: 100%;
    margin-top: 0.75rem;
}

@media (max-width: 560px) {
    .auth-title {
        font-size: 1.45rem;
    }

    .auth-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .auth-modal-overlay .auth-modal {
        width: 100%;
        max-width: none;
        max-height: min(92dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
        margin: 0;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .auth-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .auth-modal-body,
    .auth-modal-panel {
        padding: 1.75rem 1.1rem 1.35rem;
    }

    .auth-mode-tab {
        min-height: 44px;
    }

    .auth-card {
        padding: 1.75rem 1.1rem 1.5rem;
    }
}
