/* ==========================================================================
   MedMentor-IA Auth Pages (Login/Register) - Modern Responsive Design
   ========================================================================== */

/* CSS Variables */
:root {
    --auth-primary: #4F46E5;
    --auth-primary-dark: #4F46E5;
    --auth-gradient-start: #4F46E5;
    --auth-gradient-end: #3B82F6;
    --auth-bg-light: #f8f9fa;
    --auth-text-muted: #6c757d;
    --auth-border-color: #dee2e6;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
}

/* ==========================================================================
   Wrapper Layout
   ========================================================================== */

.auth-wrapper {
    min-height: calc(100vh - 76px); /* Minus navbar height */
    display: flex;
    background: var(--auth-bg-light);
}

/* ==========================================================================
   Left Column - Branding (Desktop only)
   ========================================================================== */

.auth-brand-column {
    flex: 1;
    background: linear-gradient(135deg, var(--auth-gradient-start) 0%, var(--auth-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-column::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    color: white;
    text-align: center;
    max-width: 400px;
}

.auth-brand-logo {
    font-size: 4rem;
    color: white;
    animation: heartbeat 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(1.1); }
    20%, 40% { transform: scale(1); }
}

.auth-brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.auth-brand-text {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.95;
}

.auth-brand-features {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
    margin-top: 1.5rem;
}

.auth-brand-features li {
    padding: 0.5rem 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-brand-features i {
    color: #4ade80;
    font-size: 1.2rem;
}

/* ==========================================================================
   Right Column - Form
   ========================================================================== */

.auth-form-column {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: white;
}

.auth-form-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

/* Mobile branding */
.auth-brand-mobile {
    margin-bottom: 1.5rem;
}

.auth-brand-mobile .auth-brand-logo {
    font-size: 3rem;
    color: var(--auth-primary);
}

.auth-brand-mobile .auth-brand-title {
    font-size: 1.75rem;
    color: var(--auth-primary);
}

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

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 1rem;
    color: var(--auth-text-muted);
    margin: 0;
}

/* Messages */
.auth-messages {
    margin-bottom: 1.5rem;
}

.auth-messages .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: none;
    box-shadow: var(--shadow-sm);
}

.auth-messages .alert:last-child {
    margin-bottom: 0;
}

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

.form-group .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3436;
    margin-bottom: 0.5rem;
}

.form-group .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--auth-border-color);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group .input-group:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-group .input-group-text {
    background: white;
    border: none;
    color: var(--auth-text-muted);
    padding: 0.625rem 0.75rem;
}

.form-group .form-control {
    border: none;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    height: auto;
}

.form-group .form-control:focus {
    box-shadow: none;
}

.form-group .btn-outline-secondary {
    border: none;
    background: transparent;
    color: var(--auth-text-muted);
    padding: 0.625rem 0.75rem;
}

.form-group .btn-outline-secondary:hover {
    background: rgba(0,0,0,0.05);
    color: #2d3436;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    margin-top: 0.25rem;
    display: block;
}

.form-hint i {
    margin-right: 0.25rem;
}

.form-error {
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Auth Button */
.btn-auth {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--auth-border-color);
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Social Buttons */
.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background: white;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-google i {
    font-size: 1.2rem;
}

/* Footer */
.auth-footer {
    font-size: 0.95rem;
    color: var(--auth-text-muted);
    margin-top: 1.5rem;
    text-align: center;
}

.auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .auth-brand-column {
        padding: 2rem;
    }

    .auth-brand-title {
        font-size: 2rem;
    }

    .auth-brand-text {
        font-size: 1rem;
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    .auth-wrapper {
        min-height: 100vh;
        flex-direction: column;
    }

    .auth-brand-column {
        display: none; /* Hide branding column on mobile */
    }

    .auth-form-column {
        padding: 2rem 1.5rem;
    }

    .auth-form-container {
        padding: 1.5rem 1rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
    .auth-form-column {
        padding: 1.5rem 1rem;
    }

    .auth-form-container {
        padding: 1rem 0.75rem;
    }

    .auth-brand-mobile .auth-brand-logo {
        font-size: 2.5rem;
    }

    .auth-brand-mobile .auth-brand-title {
        font-size: 1.5rem;
    }

    .btn-auth,
    .btn-google {
        padding: 0.625rem 1rem;
        font-size: 0.95rem;
    }
}

/* Large Desktop (min 1400px) */
@media (min-width: 1400px) {
    .auth-form-container {
        max-width: 480px;
    }

    .auth-brand-content {
        max-width: 500px;
    }

    .auth-brand-title {
        font-size: 3rem;
    }

    .auth-brand-logo {
        font-size: 5rem;
    }
}

/* ==========================================================================
   Animation - Fade In
   ========================================================================== */

.auth-wrapper {
    animation: fadeIn 0.4s ease-out;
}

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

/* ==========================================================================
   Focus Styles for Accessibility
   ========================================================================== */

.auth-form-container a:focus,
.auth-form-container button:focus,
.auth-form-container input:focus {
    outline: 2px solid var(--auth-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

[data-theme="dark"] .auth-form-column {
    background: #1e1e1e;
}

[data-theme="dark"] .auth-form-container {
    background: #2d2d2d;
}

[data-theme="dark"] .auth-title {
    color: #e0e0e0;
}

[data-theme="dark"] .form-group .form-label {
    color: #e0e0e0;
}

[data-theme="dark"] .form-group .input-group {
    border-color: #444;
}

[data-theme="dark"] .form-group .input-group-text,
[data-theme="dark"] .form-group .form-control {
    background: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-google {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .btn-google:hover {
    background: #3d3d3d;
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
    border-bottom-color: #444;
}

[data-theme="dark"] .auth-footer {
    color: #adb5bd;
}
