/* Shared styles for the authentication pages (login, signup, etc.) */

body {
    /* Auth pages are a special case that need to center their content */
    display: grid;
    place-items: center;
    padding: 2rem;
    min-height: 100vh;
    background-color: var(--color-background);
    background-image: radial-gradient(circle at 50% 0%, var(--color-surface) 0%, var(--color-background) 80%); /* Subtle gradient match */
    margin: 0;
    box-sizing: border-box;
}

.auth-container {
    width: 100%;
    max-width: 440px; /* Slightly tighter width for better focus */
    text-align: center;
    background: rgba(var(--color-surface-rgb), 0.8); /* Slightly more transparent */
    backdrop-filter: blur(20px) saturate(180%); /* stronger blur for premium glass feel */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    border: 1px solid rgba(var(--color-border-rgb), 0.5); /* Softer border */
    box-shadow: 0 20px 40px -10px rgba(0,0,0, 0.1), 0 0 0 1px rgba(255,255,255,0.05); /* Multi-layered shadow */
    box-sizing: border-box;
    
    /* Subtle entry animation */
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: scale(0.95);
}

@keyframes scaleIn {
    to { opacity: 1; transform: scale(1); }
}

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

.auth-header .headline {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    letter-spacing: -0.03em;
}

.auth-header .subheadline {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* --- Input Groups & Icons --- */
.input-group {
    position: relative;
    margin-bottom: 1.25rem; /* Increased spacing */
}

/* Icon Container (Left) */
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none; /* Let clicks pass through */
    width: 20px;
    height: 20px;
    transition: color 0.2s ease;
    z-index: 2;
}

.form-input {
    width: 100%;
    /* Add padding-left to accommodate icon if present. 
       We use a general class or assume inputs in .input-group might have icons. 
       Let's default to standard padding and override if icon is present. */
    padding: 1rem 1.25rem;
    padding-left: 3rem; /* Space for icon */
    background: rgba(var(--color-background-rgb), 0.6); /* Semi-transparent input bg */
    border: 1px solid var(--color-border);
    border-radius: 14px; /* Slightly rounder */
    color: var(--color-text);
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* Highlight icon when input is focused */
.form-input:focus + .input-icon,
.input-group:focus-within .input-icon {
    color: var(--color-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.15);
    background: var(--color-surface);
    transform: translateY(-1px); /* Micro-lift on focus */
}

.form-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Password Toggle Button Styles */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.2s;
}

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

.password-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* --- Error Messages --- */
.error-message-container {
    background-color: rgba(var(--color-error-rgb), 0.08);
    border: 1px solid rgba(var(--color-error-rgb), 0.15);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

#error-message, .error-text {
    color: var(--color-error);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

/* --- Buttons --- */
.cta-button {
    width: 100%;
    display: flex; /* Flex for centering content/spinner */
    justify-content: center;
    align-items: center;
    padding: 1rem;
    font-size: 1.05rem;
    border-radius: 14px;
    background-color: var(--color-primary);
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cta-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--color-primary-rgb), 0.3);
    filter: brightness(105%);
}

.cta-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.2);
}

.cta-button:disabled {
    background-color: var(--color-surface); /* Muted background */
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.secondary-link {
    color: var(--color-text-muted);
    text-decoration: none;
    margin-top: 1.5rem;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* --- Social Sign-in --- */
.social-signin {
    margin-bottom: 1.5rem;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    background-color: var(--color-background); /* White/Dark bg */
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* FIX: Constrain SVG size for Google Icon */
.social-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.social-btn:hover {
    background-color: var(--color-surface);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--color-text-muted); /* Darken border slightly */
}

/* --- Divider --- */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.6;
}

.divider::before,
.divider::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: var(--color-border);
}

/* Legal Footer */
.legal-footer {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 2rem;
    line-height: 1.5;
    opacity: 0.8;
}

.legal-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.legal-footer a:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    body {
        padding: 1rem; /* Restore some padding */
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-color: var(--color-surface); /* Solid bg on mobile often feels more stable */
    }

    .auth-container {
        padding: 2rem 1.5rem;
        border: none; 
        box-shadow: none;
        background: transparent; /* Seamless blend */
        backdrop-filter: none;
        flex-grow: 1; 
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .auth-header .headline {
        font-size: 1.75rem;
    }
}
