/**
 * Auth Page CSS - LoveToRead.AI
 * Sign In / Sign Up Page Styles
 */

/* CSS Variables - Matching Landing Page */
:root {
    --primary-green: #2e7d32;
    --primary-green-light: #4caf50;
    --primary-green-lighter: #66bb6a;
    --primary-green-dark: #1b5e20;
    --accent-green: #81c784;
    --bg-green-light: #e8f5e9;
    
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6a6a6a;
    
    --white: #ffffff;
    --off-white: #fafafa;
    --border-light: #e0e0e0;
    
    --error-red: #c62828;
    --error-bg: #ffebee;
    --success-green: #2e7d32;
    --success-bg: #e8f5e9;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
}

/* Main Container */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ===================================
   LEFT SIDE - HERO SECTION
   =================================== */

.auth-hero {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-lighter) 50%, var(--accent-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    padding: 60px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* Hero Logo */
.hero-logo {
    margin-bottom: 40px;
}

.hero-logo-img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* Hero Text */
.hero-title {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 48px;
    opacity: 0.95;
    line-height: 1.6;
    font-weight: 400;
}

/* Hero Features */
.hero-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
    align-items: center;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 32px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
    width: 100%;
    max-width: 400px;
}

.hero-feature:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(8px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.feature-text strong {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.feature-text span {
    font-size: 14px;
    opacity: 0.9;
}

/* Hero Footer */
.hero-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-footer-text {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
}

/* Hero Background Decoration */
.hero-bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* ===================================
   RIGHT SIDE - AUTH FORM
   =================================== */

.auth-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 40px;
    overflow-y: auto;
}

.auth-form-container {
    width: 100%;
    max-width: 480px;
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 32px;
    transition: all var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-green);
    gap: 12px;
}

.back-link i {
    font-size: 14px;
}

/* Auth Box */
.auth-box {
    width: 100%;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.2;
}

.auth-description {
    font-size: 16px;
    color: var(--text-medium);
    margin-bottom: 32px;
}

/* Message Boxes */
.message-box {
    padding: 14px 16px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
}

.error-message {
    background: var(--error-bg);
    color: var(--error-red);
    border-color: rgba(198, 40, 40, 0.2);
}

.success-message {
    background: var(--success-bg);
    color: var(--success-green);
    border-color: rgba(46, 125, 50, 0.2);
}

/* Auth Buttons */
.auth-button {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.auth-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

/* Google Button */
.google-button {
    background: #4285f4;
    color: var(--white);
    margin-bottom: 24px;
}

.google-button:hover:not(:disabled) {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.google-button i {
    font-size: 18px;
}

/* Primary Button */
.primary-button {
    background: var(--primary-green);
    color: var(--white);
}

.primary-button:hover:not(:disabled) {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Divider */
.divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
    z-index: 1;
}

.divider-text {
    background: var(--white);
    padding: 0 16px;
    position: relative;
    z-index: 2;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Email Form */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-fast);
    color: var(--text-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green-light);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Toggle Section */
.toggle-section {
    margin-top: 24px;
    text-align: center;
}

.toggle-text {
    color: var(--text-medium);
    font-size: 15px;
}

.toggle-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: color var(--transition-fast);
}

.toggle-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Auth Footer */
.auth-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.footer-note {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
}

.footer-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .hero-title {
        font-size: 48px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .auth-hero {
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-hero {
        flex: none;
        min-height: auto;
        padding: 40px 24px;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-logo {
        margin-bottom: 24px;
    }
    
    .hero-logo-img {
        height: 60px;
    }
    
    .hero-title {
        font-size: 36px;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .hero-features {
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .hero-feature {
        padding: 16px 24px;
        max-width: 100%;
    }
    
    .hero-feature:hover {
        transform: translateX(4px);
    }
    
    .feature-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .feature-text strong {
        font-size: 20px;
    }
    
    .feature-text span {
        font-size: 13px;
    }
    
    .hero-footer {
        margin-top: 32px;
        padding-top: 24px;
    }
    
    .hero-footer-text {
        font-size: 14px;
    }
    
    /* Form Section on Mobile */
    .auth-form-section {
        flex: 1;
        padding: 32px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .auth-form-container {
        max-width: 100%;
    }
    
    .back-link {
        margin-bottom: 24px;
    }
    
    .auth-title {
        font-size: 28px;
    }
    
    .auth-description {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .auth-button {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .form-input {
        padding: 11px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .auth-hero {
        padding: 32px 20px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }
    
    .hero-features {
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .hero-feature {
        padding: 14px 20px;
        gap: 16px;
    }
    
    .feature-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .feature-text strong {
        font-size: 18px;
    }
    
    .feature-text span {
        font-size: 12px;
    }
    
    .auth-form-section {
        padding: 24px 16px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-description {
        font-size: 14px;
    }
    
    .email-form {
        gap: 16px;
    }
    
    .form-group {
        gap: 6px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .toggle-section {
        margin-top: 20px;
    }
    
    .toggle-text {
        font-size: 14px;
    }
    
    .auth-footer {
        margin-top: 24px;
        padding-top: 20px;
    }
    
    .footer-note {
        font-size: 12px;
    }
}

/* Landscape Mobile Fix */
@media (max-width: 768px) and (max-height: 500px) {
    .auth-container {
        flex-direction: row;
    }
    
    .auth-hero {
        flex: 0.4;
        min-height: 100vh;
    }
    
    .hero-features {
        display: none;
    }
    
    .hero-footer {
        display: none;
    }
    
    .auth-form-section {
        flex: 0.6;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-hero {
        background: var(--primary-green);
    }
    
    .form-input:focus {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-feature:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .auth-hero {
        display: none;
    }
    
    .auth-container {
        display: block;
    }
    
    .back-link,
    .google-button,
    .toggle-section,
    .auth-footer {
        display: none;
    }
}