/* file: css/login.css */
@import url('https://fonts.googleapis.com/css2?family=Aharoni&display=swap');

:root {
    --mdc-theme-primary: #3f51b5;
    --mdc-theme-on-primary: #ffffff;
    --mdc-theme-secondary: #f50057;
    --mdc-theme-surface: #ffffff;
    --mdc-theme-on-surface: #000000;
    --mdc-theme-text-primary-on-background: rgba(0, 0, 0, 0.87);
    --mdc-theme-text-secondary-on-background: rgba(0, 0, 0, 0.6);
    --mdc-theme-text-disabled-on-background: rgba(0, 0, 0, 0.38);
    --mdc-theme-error: #b00020;
    --mdc-shape-corner-medium: 12px;
    --mdc-shape-corner-small: 4px;
    --mdc-elevation-2: 0 2px 4px rgba(0, 0, 0, 0.2);
    --branding-gradient-start: #3f51b5;
    --branding-gradient-end: #f50057;
    --branding-text: #ffffff;
}

/* Dark Theme Override */
.dark {
    --mdc-theme-surface: #121212;
    --mdc-theme-on-surface: #ffffff;
    --mdc-theme-text-primary-on-background: rgba(255, 255, 255, 0.87);
    --mdc-theme-text-secondary-on-background: rgba(255, 255, 255, 0.6);
    --mdc-theme-text-disabled-on-background: rgba(255, 255, 255, 0.38);
    --mdc-theme-error: #cf6679;
    --mdc-elevation-2: 0 2px 4px rgba(0, 0, 0, 0.4);
    --branding-text: #e0e0e0;
}

body {
    margin: 0px;
}

/* Page Layout */
.login-page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    background-color: var(--mdc-theme-surface);
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.login-page.fade-out {
    opacity: 0;
}

/* Branding Section (65%) */
.branding-section {
    flex: 0 0 65%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    color: var(--branding-text);
    overflow: hidden;
    border-top-right-radius: 60px;
    border-bottom-right-radius: 60px;
}

/* Form Section (35%) */
.form-section {
    flex: 0 0 35%;
    background-color: var(--mdc-theme-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

/* Form Card */
.login-card {
    background: var(--mdc-theme-surface);
    border-radius: var(--mdc-shape-corner-medium);
    max-width: 400px;
    width: 100%;
    padding: 24px;
}

/* Error Alert */
.error-alert {
    background-color: var(--mdc-theme-error);
    color: var(--mdc-theme-on-primary);
    padding: 16px;
    border-radius: var(--mdc-shape-corner-small);
    margin-bottom: 24px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

/* Typography */
.mdc-typography--headlineMedium {
    font-family: 'Roboto', sans-serif;
    font-size: 36px;
    line-height: 44px;
    font-weight: 400;
    color: var(--branding-text);
    margin: 0;
}

.mdc-typography--bodyLarge {
    font-family: 'Aptos', 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
    color: var(--branding-text);
    opacity: 0.8;
    margin: 16px 0 0 0;
}

.mdc-typography--headlineSmall {
    font-family: 'Aharoni', sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: 500;
    color: var(--mdc-theme-text-primary-on-background);
    margin: 0 0 24px;
    text-align: center;
}

.mdc-typography--bodySmall {
    font-family: 'Aptos', 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    color: var(--mdc-theme-text-secondary-on-background);
}

.mdc-typography--labelLarge {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: var(--mdc-theme-text-primary-on-background);
}

/* Buttons */
.mdc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 100px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    text-transform: none;
    cursor: pointer;
    background-color: rgba(29, 27, 32, 0.12);
    border: 0px;
}

.mdc-button--outlined {
    border: 1px solid var(--mdc-theme-text-disabled-on-background);
    background: none;
    color: var(--mdc-theme-text-primary-on-background);
}

.mdc-button--filled {
    background-color: rgba(255, 155, 21, 1);
    color: black;
    border: none;
    border-radius: 100px;
}

.mdc-button__icon {
    font-size: 20px;
    margin-right: 8px;
}

/* Text Fields */
.mdc-text-field {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
}

.mdc-text-field__input {
    width: 100%;
    height: 56px;
    padding: 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: var(--mdc-theme-text-primary-on-background);
    border: none;
    outline: none;
    background: none;
}

.mdc-notched-outline {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    border: 1px solid var(--mdc-theme-text-disabled-on-background);
    border-radius: var(--mdc-shape-corner-small);
}

.mdc-notched-outline__notch {
    padding: 0 8px;
}

.mdc-floating-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--mdc-theme-surface);
    padding: 0 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: var(--mdc-theme-text-secondary-on-background);
    pointer-events: none;
}

.mdc-text-field__input:focus+.mdc-notched-outline,
.mdc-text-field__input:not(:placeholder-shown)+.mdc-notched-outline {
    border-color: var(--mdc-theme-primary);
}

/* Checkbox */
.mdc-form-field {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.mdc-checkbox {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.mdc-checkbox__native-control {
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.mdc-checkbox__background {
    position: absolute;
}

/* Links */
a {
    color: var(--mdc-theme-primary);
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
}

a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (min-width: 2560px) {
    /* Ultra-wide desktop (4K) */
    .login-page {
        min-height: 100vh;
    }
    
    .form-section {
        flex: 0 0 30%;
        padding: 32px 40px 32px 60px;
    }
    
    .login-card {
        max-width: 500px;
        width: 100%;
        padding: 40px;
    }
    
    .mdc-typography--headlineSmall {
        font-size: 32px;
    }
    
    .mdc-text-field__input {
        height: 64px;
        font-size: 18px;
    }
}

@media (min-width: 1920px) and (max-width: 2559px) {
    /* Large desktop (1920-2559px) */
    .form-section {
        flex: 0 0 32%;
        padding: 32px 40px 32px 50px;
    }
    
    .login-card {
        max-width: 450px;
        width: 100%;
        padding: 36px;
    }
    
    .mdc-typography--headlineSmall {
        font-size: 28px;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    /* Standard large desktop (1440-1919px) */
    .form-section {
        flex: 0 0 34%;
        padding: 32px 35px 32px 40px;
    }
    
    .login-card {
        max-width: 420px;
        width: 100%;
        padding: 30px;
    }
    
    .mdc-typography--headlineSmall {
        font-size: 26px;
    }
    
    .mdc-text-field__input {
        height: 54px;
        font-size: 15px;
    }
}

@media (min-width: 1024px) and (max-width: 1439px) {
    /* Medium desktop (1024-1439px) */
    .branding-section {
        flex: 0 0 65%;
    }
    
    .form-section {
        flex: 0 0 35%;
    }
    
    .login-card {
        max-width: 380px;
        width: calc(100% - 56px);
        padding: 28px;
    }
    
    .mdc-typography--headlineSmall {
        font-size: 22px;
    }
}

@media (max-width: 1023px) {
    /* Tablet and small desktop fallback */
    .login-page {
        flex-direction: column;
    }

    .form-section {
        order: 1;
        flex: 0 0 auto;
        width: 100%;
        min-height: auto;
        padding: 24px 16px;
    }

    .branding-section {
        order: 2;
        flex: 1;
        width: 100%;
        min-height: 50vh;
        padding: 0;
        background: transparent;
    }

    .login-card {
        width: calc(100% - 32px);
        margin-right: 0;
    }

    .mdc-typography--headlineMedium {
        font-size: 28px;
        line-height: 36px;
    }

    .mdc-typography--bodyLarge {
        font-size: 14px;
        line-height: 20px;
    }
}

@media (max-width: 480px) {
    .branding-section,
    .form-section {
        min-height: 40vh;
    }

    .login-card {
        width: calc(100% - 32px);
        padding: 16px;
    }

    .mdc-typography--headlineSmall {
        font-size: 20px;
        line-height: 28px;
    }
}

/* Success Alert */
.success-alert {
    background-color: #4caf50; /* Green for success */
    color: var(--mdc-theme-on-primary);
    padding: 16px;
    border-radius: var(--mdc-shape-corner-small);
    margin-bottom: 24px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

/* Carousel Integration Styles */
.branding-section .homepage-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    border-top-right-radius: 60px;
    border-bottom-right-radius: 60px;
}

.branding-section .homepage-carousel .logo {
    top: 25px;
    left: 35px;
    max-width: 150px;
}

@media (max-width: 768px) {
    .branding-section .homepage-carousel {
        border-radius: 0;
    }
    
    .branding-section .homepage-carousel .logo {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
    }
}
