/* Authentication UI Styles for Pro Coach Studio
   Tokens below alias the shared theme system in styles.css (loaded first on
   every auth page) so light/dark mode reaches this file automatically. */
:root {
    --auth-text-color: var(--text-color);
    --auth-text-muted: var(--text-muted);
    --auth-bg-primary: var(--bg-color-light);
    --auth-bg-secondary: var(--bg-color-lighter);
    --auth-border-color: var(--border-color);
    --auth-accent-color: var(--primary-color);
    --auth-accent-hover: var(--primary-hover);
    --auth-success-bg: var(--success-tint);
    --auth-success-border: var(--success-color);
    --auth-success-text: var(--success-color);
    --auth-error-bg: var(--danger-tint);
    --auth-error-border: var(--danger-color);
    --auth-error-text: var(--danger-color);
    --auth-warning-bg: rgba(245, 158, 11, 0.12);
    --auth-warning-border: var(--warning-color);
    --auth-warning-text: var(--warning-color);
}

/* Email verification prompt */
.email-verification-prompt {
    position: relative;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--auth-warning-bg);
    border: 1px solid var(--auth-warning-border);
    color: var(--auth-warning-text);
}

.email-verification-prompt .alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-verification-prompt .alert-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.email-verification-prompt .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
}

.email-verification-prompt .btn-outline-primary {
    color: var(--auth-accent-color);
    border-color: var(--auth-accent-color);
    background: transparent;
}

.email-verification-prompt .btn-outline-primary:hover {
    background-color: var(--auth-accent-color);
    color: white;
}

.email-verification-prompt .btn-outline-secondary {
    color: var(--auth-text-muted);
    border-color: var(--auth-border-color);
    background: transparent;
}

.email-verification-prompt .btn-outline-secondary:hover {
    background-color: var(--auth-bg-secondary);
    color: var(--auth-text-color);
}

/* User info display */
.user-profile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: var(--auth-bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--auth-border-color);
}

.user-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text-color);
}

.user-name {
    font-size: 0.875rem;
    color: var(--auth-text-muted);
}

.email-unverified {
    font-size: 0.75rem;
    color: var(--auth-error-text);
    font-weight: 500;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background-color: var(--auth-success-bg);
    border: 1px solid var(--auth-success-border);
    color: var(--auth-success-text);
}

.toast-error {
    background-color: var(--auth-error-bg);
    border: 1px solid var(--auth-error-border);
    color: var(--auth-error-text);
}

.toast-info {
    background-color: var(--auth-bg-secondary);
    border: 1px solid var(--auth-border-color);
    color: var(--auth-text-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Auth-required content styling */
[data-auth-required] {
    transition: opacity 0.3s ease;
}

[data-guest-only] {
    transition: opacity 0.3s ease;
}

/* Loading states */
.auth-loading {
    opacity: 0.6;
    pointer-events: none;
}

.auth-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--auth-bg-secondary);
    border-top: 2px solid var(--auth-accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Shared auth page shell (container/card/header/footer) — canonical
   version of the block each auth page otherwise redefines inline */
.auth-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.auth-card {
    background-color: var(--auth-bg-primary);
    border: 1px solid var(--auth-border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.auth-header h1 {
    color: var(--auth-text-color);
    margin-bottom: 0.5rem;
}

.auth-header h2,
.auth-header p {
    color: var(--auth-text-muted);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.auth-footer {
    margin-top: 1.5rem;
}

.auth-footer p {
    margin: 0.5rem 0;
}

@media (min-width: 768px) {
    .auth-container {
        max-width: 550px;
    }
}

@media (min-width: 1200px) {
    .auth-container {
        max-width: 650px;
    }
}

/* Enhanced form styling for dark mode */
.auth-form {
    max-width: 650px; /* Increased from 520px */
    margin: 0 auto;
    padding: 2rem;
    background: var(--auth-bg-primary);
    border-radius: 12px;
    border: 1px solid var(--auth-border-color);
    box-shadow: var(--shadow-lg);
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

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

.auth-form .form-control {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--auth-border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--auth-bg-secondary);
    color: var(--auth-text-color);
    transition: all 0.2s ease;
}

.auth-form .form-control::placeholder {
    color: var(--auth-text-muted);
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--auth-accent-color);
    box-shadow: 0 0 0 3px var(--primary-tint);
    background-color: var(--auth-bg-primary);
}

.auth-form .form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

.auth-form .checkbox-group {
    margin: 1.5rem 0;
    text-align: center;
}

.auth-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
    text-align: left;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.auth-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    margin-top: 0.1rem;
    accent-color: var(--auth-accent-color);
    cursor: pointer;
}

.auth-link {
    color: var(--auth-accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.auth-button {
    width: 100%;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-button.primary {
    background-color: var(--auth-accent-color);
    color: white;
}

.auth-button.primary:hover:not(:disabled) {
    background-color: var(--auth-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.auth-button:disabled {
    background-color: var(--auth-bg-secondary);
    color: var(--auth-text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

/* Message styles */
.auth-messages {
    margin-bottom: 1.5rem;
}

.success-message {
    background-color: var(--auth-success-bg);
    color: var(--auth-success-text);
    border: 1px solid var(--auth-success-border);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.error-message {
    background-color: var(--auth-error-bg);
    color: var(--auth-error-text);
    border: 1px solid var(--auth-error-border);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.info-message {
    background-color: var(--auth-bg-secondary);
    color: var(--auth-text-color);
    border: 1px solid var(--auth-border-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-link-button {
    background: none;
    border: none;
    color: var(--auth-accent-color);
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    margin: 0;
}

.auth-link-button:hover {
    color: var(--auth-accent-hover);
}

.resend-verification-btn {
    background: var(--auth-warning-bg);
    color: var(--auth-warning-text);
    border: 1px solid var(--auth-warning-border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.resend-verification-btn:hover {
    background: var(--auth-warning-border);
    transform: translateY(-1px);
}

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

/* Responsive design */
@media (max-width: 768px) {
    .email-verification-prompt {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .email-verification-prompt .alert-actions {
        flex-direction: column;
    }
    
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .auth-form {
        margin: 0 1rem;
        padding: 1.5rem;
        max-width: 100%;
    }
}

/* Enhanced responsive design for better form handling on larger screens */
@media (min-width: 769px) {
    .auth-form {
        max-width: 650px;
        padding: 2.5rem;
    }
    
    .auth-form .form-control {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .auth-form .checkbox-label {
        max-width: 450px;
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .auth-form {
        max-width: 700px;
        padding: 3rem;
    }
    
    .auth-form .form-control {
        padding: 1.1rem;
    }
}

/* Email Verification Page Specific Styles */
.verification-info {
    text-align: center;
    margin-bottom: 2rem;
}

.email-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--auth-bg-secondary);
    border: 1px solid var(--auth-border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.email-display i {
    color: var(--auth-accent-color);
    font-size: 1.1rem;
}

.verification-message {
    color: var(--auth-text-muted);
    line-height: 1.6;
}

.resend-cooldown {
    text-align: center;
    margin-top: 1rem;
}

.resend-cooldown i {
    margin-right: 0.25rem;
}

/* Button enhancements for verification page */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn i {
    margin-right: 0.5rem;
}
