/* File: static/css/pages/auth.css */
/* Shared styles for /login, /forgot-password, /set-password, and the */
/* /auth/handle-fragment handler page. Auth pages don't extend base.html */
/* (they intentionally have no nav chrome), so this stylesheet imports */
/* only the foundational tokens + resets it needs. */

@import '../base/variables.css';
@import '../base/reset.css';
@import '../base/typography.css';
@import '../components/notifications.css';

body {
    background: #fafbfc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card / container */

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-xl);
}

.login-card {
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: var(--spacing-3xl);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Header */

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.logo-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.logo-icon-large {
    width: 40px;
    height: 40px;
    color: #00a499;
}

.logo-text-large {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.login-subtitle {
    color: #6b7280;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
    font-weight: 400;
}

/* Form */

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.form-label {
    font-weight: 500;
    color: #374151;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.form-input {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: var(--font-size-base);
    transition: all 0.15s ease;
    font-family: inherit;
    background: #fafbfc;
}

.form-input:focus {
    outline: none;
    border-color: #00a499;
    background: var(--background);
    box-shadow: 0 0 0 3px rgb(0 164 153 / 0.1);
}

/* The OTP code input uses a monospace-ish treatment to make the six */
/* digits easy to scan. */
.form-input.otp-input {
    letter-spacing: 0.4em;
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-size: var(--font-size-lg);
}

/* Buttons */

.login-btn {
    padding: 14px 20px;
    background: #00a499;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-family: inherit;
    width: 100%;
}

.login-btn:hover:not(:disabled) {
    background: #008a7f;
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mode toggle + secondary links */

.mode-toggle {
    background: none;
    border: none;
    color: #00a499;
    font-size: var(--font-size-sm);
    cursor: pointer;
    padding: var(--spacing-xs) 0;
    font-family: inherit;
    text-decoration: underline;
    margin-top: var(--spacing-sm);
}

.mode-toggle:hover {
    color: #008a7f;
}

.secondary-links {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.secondary-links a,
.secondary-links button {
    color: #00a499;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.secondary-links a:hover,
.secondary-links button:hover {
    text-decoration: underline;
}

.secondary-links-stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.secondary-links-stacked a {
    color: #00a499;
    text-decoration: none;
}

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

.resend-link {
    background: none;
    border: none;
    color: #00a499;
    font-size: var(--font-size-sm);
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
}

.resend-link:hover {
    color: #008a7f;
}

/* Spinner & alerts override */

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: flex;
}

.loading-spinner.large {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #00a499;
    margin: 0 auto var(--spacing-lg);
}

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

.alert {
    margin-bottom: var(--spacing-lg);
}

.help-text {
    font-size: var(--font-size-xs);
    color: #9ca3af;
    text-align: center;
    margin-top: var(--spacing-xl);
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Magic-link fragment handler page (auth_handler.html) */

.auth-container {
    text-align: center;
    padding: var(--spacing-3xl);
}

.auth-message {
    color: #6b7280;
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-lg);
}

.auth-container .alert {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--spacing-lg);
}

/* Small screens */

@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-lg);
    }

    .login-card {
        padding: var(--spacing-xl);
    }
}
