/* Authentication Pages - Clean, Modern Styles */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.auth-card {
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    padding: 3rem 2.5rem;
}

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

.auth-logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

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

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: var(--error-bg, #fee);
    color: var(--error, #c00);
    border-left: 4px solid var(--error, #c00);
}

.alert-success {
    background: var(--success-bg, #efe);
    color: var(--success, #0a0);
    border-left: 4px solid var(--success, #0a0);
}

.alert p {
    margin: 0;
    font-size: 0.9rem;
}

.alert p + p {
    margin-top: 0.5rem;
}

/* Form Styles */
.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border, #ddd);
    border-radius: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.code-input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    font-family: 'Courier New', monospace;
}

.form-text {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Email Display (when showing password step) */
.email-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    border: 2px solid var(--border, #ddd);
}

.email-display strong {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-primary {
    background: var(--primary, #007bff);
    color: #ffffff;
    border-color: var(--primary, #007bff);
}

.btn-primary:hover {
    background: var(--primary-dark, #0056b3);
    border-color: var(--primary-dark, #0056b3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border, #ddd);
}

.btn-secondary:hover {
    background: var(--bg-hover, #f8f9fa);
    border-color: var(--primary, #007bff);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary, #f8f9fa);
    border-color: var(--border, #ddd);
    color: var(--text-secondary);
}

.btn-secondary:disabled:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-secondary, #f8f9fa);
    border-color: var(--border, #ddd);
}

.btn-google {
    background: #ffffff;
    color: #444;
    border-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.google-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary, #007bff);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-dark, #0056b3);
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.link-secondary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
}

.link-secondary:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

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

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: var(--bg-card, #ffffff);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

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

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

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

.auth-footer-info {
    text-align: center;
    margin-top: 1rem;
}

.auth-footer-info p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.auth-footer-info a {
    color: var(--text-secondary);
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.75rem;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: var(--border, #ddd);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    background: #dc3545;
}

.password-strength-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.strength-weak .password-strength-fill {
    width: 25%;
    background: #dc3545;
}

.strength-fair .password-strength-fill {
    width: 50%;
    background: #ffc107;
}

.strength-good .password-strength-fill {
    width: 75%;
    background: #28a745;
}

.strength-strong .password-strength-fill {
    width: 100%;
    background: #28a745;
}

/* Password Requirements */
.password-requirements {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.password-requirements p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-requirements li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.password-requirements li::before {
    content: '○';
    position: absolute;
    left: 0;
    color: var(--text-tertiary);
}

.password-requirements li.valid {
    color: var(--success, #28a745);
}

.password-requirements li.valid::before {
    content: '✓';
    color: var(--success, #28a745);
}

/* Verification Spinner Overlay */
.verification-spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.verification-spinner-overlay.active {
    display: flex;
}

/* Local spinner for auth pages only - namespaced to avoid conflicts */
.auth-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border, #ddd);
    border-top-color: var(--primary, #007bff);
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

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

.verification-spinner-overlay p {
    margin-top: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Dark Theme Support */
[data-theme="dark"] .auth-container {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .auth-card {
    background: var(--bg-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .email-display {
    background: var(--bg-secondary);
}

[data-theme="dark"] .verification-spinner-overlay {
    background: rgba(0, 0, 0, 0.95);
}

/* Responsive */
@media (max-width: 576px) {
    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .code-input {
        font-size: 1.25rem;
        letter-spacing: 0.3em;
    }
}
