/**
 * Authentication Pages Styles
 * Styles for login, register, and password reset pages
 */

/* Auth Page Layout */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
}


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

.auth-container--wide {
    max-width: 760px;
}

.auth-header .subtitle {
    max-width: 720px;
    margin: 0 auto 2rem;
}

.auth-container--compact {
    padding: 2rem;
}

.auth-container--compact .auth-header {
    margin-bottom: 1rem;
}

.auth-container--compact .main-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.5rem;
}

.auth-container--compact .subtitle {
    margin-bottom: 1.25rem;
}

.auth-container--compact .auth-form {
    gap: 1rem;
}

.auth-container--compact .form-group {
    gap: 0.35rem;
}

.auth-container--compact .form-group input {
    padding: 0.6rem 0.9rem;
}


@media (min-width: 768px) {
    .auth-form--2col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.25rem;
        row-gap: 1rem;
    }

    .auth-form--2col > .form-group:last-of-type,
    .auth-form--2col > .cta-button {
        grid-column: 1 / -1;
    }
}

.auth-page {
    padding: 120px 0 80px;
}

.auth-header .main-title {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    margin-bottom: 0.75rem;
}

.auth-header .subtitle {
    max-width: 720px;
    margin: 0 auto 2rem;
}


.auth-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    text-align: center;
}

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

/* Auth Form */
.auth-form {
    text-align: left;
}

/* Password Field */
.password-field {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 3rem;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Error Messages */
.form-group .error-message {
    display: block;
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.form-group.has-error input,
.form-group.has-error .password-input-wrapper input {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password field specific error styling */
.password-field .error-message {
    margin-top: 0.5rem;
    clear: both;
}

/* Form group spacing */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Small text styling */
.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Ensure error messages appear below small text */
.form-group small + .error-message {
    margin-top: 0.25rem;
}

/* Remember Me Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Auth Buttons */
.auth-button {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.auth-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.auth-button.loading {
    position: relative;
    color: transparent;
}

.auth-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

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

.auth-divider span {
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Social Login Buttons */
.social-login {
    margin-bottom: 1.5rem;
}

.social-button {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.social-button:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.social-button:last-child {
    margin-bottom: 0;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.alert-error {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

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

.strength-bar {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-weak .strength-fill {
    width: 25%;
    background: var(--error-color);
}

.strength-fair .strength-fill {
    width: 50%;
    background: var(--warning-color);
}

.strength-good .strength-fill {
    width: 75%;
    background: var(--info-color);
}

.strength-strong .strength-fill {
    width: 100%;
    background: var(--success-color);
}

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

/* Terms and Privacy */
.terms-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
    margin-top: 1rem;
}

.terms-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem 0;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
}

@media (min-width: 768px) {
    .auth-form--2col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1.25rem;
        row-gap: 1rem;
    }

    .auth-form--2col > .form-group:last-of-type,
    .auth-form--2col > .cta-button {
        grid-column: 1 / -1;
    }

    .auth-form--2col > .form-group--full {
        grid-column: 1 / -1;
    }
}
