/* Authentication Pages Styles - Fresh Modern Design */

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Main auth container - Full screen two column layout */
.auth-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    background: white;
    overflow: hidden;
}

/* Image section - 55-60% width */
.auth-image-section {
    flex: 0 0 58%;
    position: relative;
    overflow: hidden;
}

.auth-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Form section - 40-45% width */
.auth-form-section {
    flex: 0 0 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 3rem;
    background: white;
}

/* Hide old layout elements */
.auth-hero-bleed,
.auth-panel {
    display: none !important;
}

.auth-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    animation: slideUp 0.6s ease-out;
    border: none;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
}

.auth-logo img {
    width: 40px;
    height: 40px;
}

.auth-logo h1 {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.logo-text {
    width: 48px;
    height: 48px;
    background: #667eea;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.auth-header h2 {
    color: #1a202c;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-header p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
}

/* Form Styles */
.auth-form {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a202c;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: #fafbff;
}

.form-group input:invalid:not(:focus):not([data-pristine]) {
    border-color: #e53e3e;
}

.form-group input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #38a169;
}

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

.strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

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

.strength-fill.weak {
    width: 25%;
    background: #e53e3e;
}

.strength-fill.medium {
    width: 50%;
    background: #ed8936;
}

.strength-fill.strong {
    width: 75%;
    background: #38a169;
}

.strength-fill.very-strong {
    width: 100%;
    background: #2d3748;
}

.strength-text {
    font-size: 0.8rem;
    color: #666;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-group .checkbox-label {
    align-items: flex-start;
    line-height: 1.4;
}

.checkbox-group .checkmark {
    margin-top: 2px;
    flex-shrink: 0;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
    text-align: center;
    line-height: 1.5;
}

.btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-full {
    width: 100%;
    margin-bottom: 1.5rem;
}

.btn-google {
    background: white;
    border: 2px solid #e2e8f0;
    color: #1a202c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    border-color: #667eea;
    background: #fafbff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Divider */
.divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: white;
    color: #6b7280;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-weight: 400;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.back-home {
    color: #6b7280 !important;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.5rem;
}

.back-home:hover {
    color: #667eea !important;
}

/* Loading State */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messages */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid #feb2b2;
}

.success-message {
    background: #c6f6d5;
    color: #2f855a;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid #9ae6b4;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile: Stack vertically with full viewport */
    .auth-container {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
    }

    .auth-image-section {
        flex: 0 0 38%;
        min-height: 38vh;
    }

    .auth-form-section {
        flex: 1;
        padding: 2.5rem 2rem;
        min-height: 62vh;
    }
    
    /* Make card spacious and immersive */
    .auth-card {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .auth-form-section {
        padding: 3rem 2rem;
    }

    /* Stack form rows into single column */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    /* Hide decorative background stripe / gradient on small screens */
    body::before {
        display: none;
    }

    /* Reduce logo size */
    .auth-logo h1 {
        font-size: 1.25rem;
    }
    .auth-logo .logo-text {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Tighter form spacing for mobile */
    .form-group {
        margin-bottom: 0.9rem;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .btn {
        padding: 12px 16px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .btn-full {
        padding: 12px 14px;
    }

    /* Stack secondary actions under primary on very small screens */
    .auth-footer, .form-options {
        width: 100%;
    }

    /* Ensure body background is simple */
    body {
        background: #f8fafc;
    }
    
    /* Mobile-only auth simplified layout */
    .auth-layout { display: none !important; }
    .auth-mobile {
        display: flex;
        width: 100vw;
        height: 100vh;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
    }
    .auth-mobile .mobile-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 2.5rem 2rem;
        border-radius: 20px;
        background: white;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(102, 126, 234, 0.05);
    }
    .auth-mobile .mobile-header {
        text-align: center;
        margin-bottom: 2rem;
    }
    .auth-mobile .mobile-header h1 {
        color: #667eea;
        font-size: 1.5rem;
        font-weight: 700;
        margin: 0 0 0.5rem 0;
        letter-spacing: -0.02em;
    }
    .auth-mobile .mobile-header h2 {
        font-size: 1.75rem;
        font-weight: 700;
        margin: 0 0 0.5rem 0;
        color: #1a202c;
        letter-spacing: -0.02em;
    }
    .auth-mobile .mobile-header p {
        color: #6b7280;
        font-size: 1rem;
        margin: 0;
        font-weight: 400;
    }
    .auth-mobile .mobile-form .form-group {
        margin-bottom: 1.25rem;
    }

    .auth-mobile .mobile-form .form-group input {
        width: 100%;
        padding: 16px 20px;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 1rem;
        line-height: 1.5;
        transition: all 0.3s ease;
    }

    .auth-mobile .mobile-form .form-group input:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        background: #fafbff;
    }

    .auth-mobile .mobile-form .btn {
        width: 100%;
        padding: 16px 24px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 1rem;
        margin-bottom: 1rem;
        transition: all 0.3s ease;
    }

    .auth-mobile .mobile-divider {
        text-align: center;
        color: #9aa3b2;
        margin: 1.5rem 0;
        position: relative;
    }
    .auth-mobile .auth-footer {
        text-align: center;
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid #f1f5f9;
    }

    .auth-mobile .auth-footer p {
        color: #6b7280;
        margin-bottom: 0.75rem;
        font-size: 0.95rem;
    }

    .auth-mobile .auth-footer a {
        color: #667eea;
        text-decoration: none;
        font-weight: 600;
        transition: color 0.3s ease;
    }

    .auth-mobile .auth-footer a:hover {
        color: #5a67d8;
        text-decoration: underline;
    }

    /* Ensure original desktop auth-page hidden */
    .auth-page.auth-layout { display: none !important; }
}

/* Hide mobile auth form on larger screens */
@media (min-width: 481px) {
    .auth-mobile {
        display: none !important;
    }
}
