/* ================================
   RESET & BASE STYLES (reset inherited from user-create.css)
   ================================ */
:root {
    /* Color Palette - Red, Dark Grey, Grey Theme - Flat Design */
    --primary-color: #f21b23;
    --primary-dark: #d91820;
    --secondary-color: #f21b23;
    --accent-color: #f21b23;
    --success-color: #4caf50;
    
    --bg-primary: #e5e5e5;
    --bg-secondary: #e5e5e5;
    --bg-card: #ffffff;
    
    --text-primary: #4d4d4f;
    --text-secondary: #4d4d4f;
    --text-muted: #4d4d4f;
    
    --border-color: #e5e5e5;
    --hover-overlay: #e5e5e5;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Shadows - Flat Design */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 3px 12px rgba(0, 0, 0, 0.18);
    --shadow-none: none;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #e5e5e5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
}

/* ================================
   SPLIT LAYOUT
   ================================ */
body.login-page {
    overflow: hidden;
    height: 100vh;
}
body.login-page #root {
    height: 100%;
    overflow: hidden;
}
body.login-page .login-wrapper {
    height: 100vh;
    overflow: hidden;
}
body.login-page .image-section {
    overflow: hidden;
}
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #ffffff;
}

/* ================================
   IMAGE SECTION
   ================================ */
.image-section {
    flex: 1;
    background: linear-gradient(135deg, #f21b23 0%, #d91820 50%, #4d4d4f 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 100vh;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(180, 15, 20, 0.76);
    /* background: linear-gradient(135deg, rgba(242, 27, 35, 0.85) 0%, rgba(77, 77, 79, 0.85) 100%); */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
}

.overlay-content {
    color: white;
    max-width: 500px;
}

.overlay-content h2 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

.overlay-content > p {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-2xl);
    opacity: 0.95;
    line-height: 1.6;
    font-style: italic;
    color: #ebebeb;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    font-style: italic;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.05rem;
    font-weight: 500;
}

.feature-item svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ================================
   FORM SECTION
   ================================ */
.form-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    background: #ffffff;
    overflow-y: auto;
    min-height: 100vh;
    border-radius: 0;
    border: none;
}

/* Login part – no border radius, no white border on form elements */
.form-section .input-field,
.form-section .login-button,
.form-section .social-button,
.form-section .checkmark,
.form-section .logo-icon {
    border-radius: 0;
}
.form-section .input-field,
.form-section .social-button {
    border: none;
}
.form-section .input-field:focus {
    box-shadow: none;
    border: none;
    background: #ffffff;
}
.form-section .input-wrapper:focus-within .input-icon {
    color: #4d4d4f;
}
.form-section .input-group:focus-within .input-label {
    color: #e5e5e5;
}
.form-section .social-button:hover {
    box-shadow: 0 2px 8px rgba(242, 27, 35, 0.15);
}
.form-section .checkmark {
    border: 2px solid rgba(229, 229, 229, 0.5);
}
.form-section .checkbox-container:hover .checkmark,
.form-section .checkbox-container input:checked ~ .checkmark {
    border-color: #f21b23;
}

/* Form section on dark grey – light text for contrast */
.form-section .subtitle {
    color: #4d4d4f;
}
.form-section .input-label {
    color: #4d4d4f;
}
.form-section .input-group:hover .input-label {
    color: #f21b23;
}
.form-section .checkbox-label {
    color: #4d4d4f;
}
.form-section .divider,
.form-section .divider-google {
    color: #4d4d4f;
}
.form-section .divider::before,
.form-section .divider::after,
.form-section .divider-google::before,
.form-section .divider-google::after {
    border-bottom-color: rgba(229, 229, 229, 0.4);
}
.form-section .signup-prompt {
        color: #4d4d4f;
}
.form-section .input-icon {
    color: #4d4d4f;
}
.form-section .toggle-password .eye-icon {
    color: #4d4d4f;
}
.form-section .toggle-password:hover .eye-icon {
    color: #4d4d4f;
}

/* ================================
   LOGIN CONTAINER - ADJUSTED FOR SPLIT LAYOUT
   ================================ */
.login-container {
    width: 100%;
    max-width: 480px;
    min-width: 280px;
    padding: 0 var(--spacing-md);
}

.login-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.login-card:hover {
    box-shadow: none;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo-icon {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-lg);
    background: #f21b23;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.logo-icon:has(.login-logo-img) {
    background: #fff;
    width: 104px;
}

/* Hidden img used only for load/error detection – prevents hover popup on visible logo */
.logo-icon .login-logo-img-loader {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.logo-icon .login-logo-img {
    width: 20rem;
    height: 56px;
    max-width: 200px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: block;
}

/* Removed pulse animation for flat design */

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: #f21b23;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ================================
   FORM STYLES
   ================================ */
.login-form {
    margin-bottom: var(--spacing-xl);
}

.input-group {
    margin-bottom: var(--spacing-lg);
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.3px;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: #e5e5e5;
    border: 2px solid #e5e5e5;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    outline: none;
}

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

.input-field:focus {
    background: #ffffff;
    border-color: #f21b23;
    box-shadow: 0 0 0 3px rgba(242, 27, 35, 0.1);
}

.input-field:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: #f21b23;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(242, 27, 35, 0.3);
    min-height: 44px;
    min-width: 44px;
}

.toggle-password:hover {
    transform: scale(1.1);
}

.toggle-password .eye-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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

/* ================================
   FORM OPTIONS
   ================================ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    font-size: 0.875rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    background: #e5e5e5;
    margin-right: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-container:hover .checkmark {
    border-color: #f21b23;
}

.checkbox-container input:checked ~ .checkmark {
    background: #f21b23;
    border-color: #f21b23;
}

.checkbox-container input:checked ~ .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    color: var(--text-secondary);
    font-weight: 400;
}

.forgot-password {
    color: #f21b23;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: #d91820;
    text-decoration: underline;
}

/* ================================
   LOGIN BUTTON
   ================================ */
.login-button {
    width: 100%;
    padding: 1rem;
    background: #f21b23;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-normal);
    box-shadow: none;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(242, 27, 35, 0.3);
    min-height: 44px;
}

.login-button:hover {
    background: #d91820;
}

.login-button:active {
    background: #c2151d;
}

.button-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.login-button:hover .button-arrow {
    transform: translateX(4px);
}

.login-button.loading {
    background: #4d4d4f;
    cursor: wait;
    pointer-events: none;
}

.login-button.success {
    background: #4caf50;
}

/* ================================
   DIVIDER
   ================================ */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-xl) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e5e5;
}

.divider span {
    padding: 0 var(--spacing-md);
}

.divider-google {
    margin: var(--spacing-2xl) 0 var(--spacing-lg);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
}

.divider-google::before,
.divider-google::after {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.divider-google span {
    padding: 0 var(--spacing-lg);
}

/* ================================
   SOCIAL LOGIN - GOOGLE
   ================================ */
.social-login {
    margin-bottom: var(--spacing-xl);
}

.google-signin-wrapper {
    position: relative;
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make the Google iframe/button fill the wrapper and look integrated */
.google-signin-wrapper > div {
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.google-signin-wrapper iframe {
    min-width: 100% !important;
    min-height: 48px !important;
}

.social-button {
    padding: 0.875rem;
    background: #e5e5e5;
    border: 2px solid #e5e5e5;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-normal);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(242, 27, 35, 0.3);
    min-height: 44px;
}

.social-button svg {
    width: 20px;
    height: 20px;
}

.social-button:hover {
    background: #ffffff;
    border-color: #f21b23;
    box-shadow: 0 2px 8px rgba(242, 27, 35, 0.15);
}

.social-button:active {
    background: #e5e5e5;
}

/* ================================
   SIGNUP PROMPT
   ================================ */
.signup-prompt {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.signup-link {
    color: #f21b23;
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.signup-link:hover {
    color: #d91820;
    text-decoration: underline;
}

/* ================================
   LOGIN PAGE – DARK THEME (NIGHT MODE)
   ================================ */
.night-mode .login-wrapper {
    background: #2e2c2c;
}

.night-mode .form-section {
    background: #2e2c2c;
}

.night-mode .form-section .subtitle {
    color: rgba(255, 255, 255, 0.9);
}

.night-mode .form-section .input-label {
    color: rgba(255, 255, 255, 0.9);
}

.night-mode .form-section .input-group:hover .input-label {
    color: #f87171;
}

.night-mode .form-section .input-wrapper:focus-within .input-label {
    color: rgba(255, 255, 255, 0.95);
}

.night-mode .form-section .input-field {
    background: #3a3838;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}

.night-mode .form-section .input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.night-mode .form-section .input-field:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #f21b23;
    box-shadow: 0 0 0 3px rgba(242, 27, 35, 0.25);
}

.night-mode .form-section .input-field:disabled,
.night-mode .form-section .input-field[readonly] {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    cursor: not-allowed;
}

.night-mode .form-section .input-icon {
    color: rgba(255, 255, 255, 0.6);
}

.night-mode .form-section .input-wrapper:focus-within .input-icon {
    color: #f87171;
}

.night-mode .form-section .toggle-password .eye-icon,
.night-mode .form-section .toggle-password:hover .eye-icon {
    color: rgba(255, 255, 255, 0.7);
}

.night-mode .form-section .divider,
.night-mode .form-section .divider-google,
.night-mode .form-section .divider span,
.night-mode .form-section .divider-google span {
    color: rgba(255, 255, 255, 0.75);
}

.night-mode .form-section .divider::before,
.night-mode .form-section .divider::after,
.night-mode .form-section .divider-google::before,
.night-mode .form-section .divider-google::after {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.night-mode .form-section .signup-prompt {
    color: rgba(255, 255, 255, 0.8);
}

.night-mode .form-section .checkbox-label {
    color: rgba(255, 255, 255, 0.9);
}

.night-mode .login-header h1 {
    color: #f87171;
}

.login-error-message {
    padding: 0.75rem;
    margin-bottom: 1rem;
    background-color: #fef2f2;
    color: #f21b23;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.night-mode .login-error-message {
    background-color: rgba(242, 27, 35, 0.2);
    color: #f87171;
    border: 1px solid rgba(242, 27, 35, 0.4);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 992px) {
    .login-wrapper {
        flex-direction: column;
    }
    
    .image-section {
        min-height: 40vh;
    }
    
    .form-section {
        min-height: calc(100vh - 40vh);
        border-radius: 0;
    }
    
    .overlay-content h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .image-section {
        min-height: 30vh;
    }
    
    .form-section {
        min-height: calc(100vh - 30vh);
        padding: var(--spacing-lg);
        border-radius: 0;
    }
    
    .overlay-content h2 {
        font-size: 1.5rem;
    }
    
    .overlay-content > p {
        font-size: 1rem;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .social-login {
        width: 100%;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
}

/* ================================
   ANIMATIONS & INTERACTIONS
   ================================ */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.input-field.error {
    border-color: #f21b23;
    animation: shake 0.5s;
}

.input-field.error:focus {
    box-shadow: 0 0 0 4px rgba(242, 27, 35, 0.2);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid #f21b23;
    outline-offset: 2px;
}