/* ===================================
   Auth Pages Styles
   =================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.auth-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

/* ===================================
   Branding Side
   =================================== */
.auth-branding {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--space-xl);
    background: var(--color-bg-elevated);
    border-right: 1px solid var(--color-border);
    overflow: hidden;
}

.auth-branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom left, var(--color-primary-glow) 0%, transparent 60%);
    opacity: 0.3;
    pointer-events: none;
}

.auth-branding .logo {
    position: relative;
    z-index: 1;
}

.branding-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    max-width: 400px;
}

.branding-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.branding-content > p {
    color: var(--color-text-secondary);
    font-size: 1.0625rem;
    margin-bottom: var(--space-2xl);
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.branding-feature {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--color-text-secondary);
}

.branding-feature svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 4px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    color: var(--color-success);
}

/* ===================================
   Form Side
   =================================== */
.auth-form-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    z-index: 1;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.auth-header {
    margin-bottom: var(--space-xl);
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--color-text-secondary);
}

/* ===================================
   Form Elements
   =================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-primary-hover);
    transition: color var(--transition-fast);
}

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

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

.input-wrapper svg {
    position: absolute;
    left: var(--space-md);
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem var(--space-md) 0.875rem 3rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.input-wrapper input::placeholder {
    color: var(--color-text-muted);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-bg-card-hover);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.input-wrapper input:focus + svg,
.input-wrapper:focus-within svg:first-child {
    color: var(--color-primary-hover);
}

.input-wrapper input.error {
    border-color: var(--color-error);
}

.input-wrapper input.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Toggle Password */
.toggle-password {
    position: absolute;
    right: var(--space-md);
    padding: var(--space-xs);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

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

/* Error Messages */
.error-message {
    font-size: 0.8125rem;
    color: var(--color-error);
    min-height: 1.25rem;
}

/* Password Strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.strength-bar.weak {
    background: var(--color-error);
}

.strength-bar.fair {
    background: var(--color-warning);
}

.strength-bar.good {
    background: var(--color-accent);
}

.strength-bar.strong {
    background: var(--color-success);
}

.strength-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.strength-text.weak { color: var(--color-error); }
.strength-text.fair { color: var(--color-warning); }
.strength-text.good { color: var(--color-accent); }
.strength-text.strong { color: var(--color-success); }

/* Checkbox */
.checkbox-group {
    margin-top: var(--space-sm);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-label input:checked + .checkmark {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.checkbox-label input:focus + .checkmark {
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.checkbox-label a {
    color: var(--color-primary-hover);
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.auth-form .btn {
    margin-top: var(--space-sm);
    position: relative;
}

.btn-loader {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

/* Auth Footer */
.auth-footer {
    margin-top: var(--space-xl);
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

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

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

/* ===================================
   Magic Link States
   =================================== */

/* Centered container for verify page */
.auth-container-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Success/Loading/Error Icons */
.success-icon,
.loading-icon,
.error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.success-icon svg {
    color: var(--color-primary);
}

.success-icon.success-check svg {
    color: var(--color-success);
}

.loading-icon svg {
    color: var(--color-primary);
}

.error-icon svg {
    color: var(--color-error);
}

/* Email Sent Info */
.email-sent-info {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.email-sent-info p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.email-sent-info p.muted {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.email-sent-info a {
    color: var(--color-primary-hover);
    cursor: pointer;
}

.email-sent-info a:hover {
    text-decoration: underline;
}

/* Verify Page States */
#verifying-state .auth-header,
#success-state .auth-header,
#error-state .auth-header {
    text-align: center;
}

#success-state .auth-header h2 {
    color: var(--color-success);
}

#error-state .auth-header h2 {
    color: var(--color-error);
}

#error-state .auth-header p {
    margin-bottom: var(--space-xl);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
    
    .auth-branding {
        display: none;
    }
    
    .auth-form-container {
        padding: var(--space-lg);
    }
    
    .auth-form-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-form-container {
        padding: var(--space-md);
    }
    
    .auth-header h2 {
        font-size: 1.25rem;
    }
}

