/*
 * Global Styles and Layout
 * Material 3 (M3) Implementation
*/

/* -- Basic Reset and Theming */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    font-family: var(--md-sys-typescale-body-large-font), sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll from any potential overflow */
}

a {
    text-decoration: none;
    color: var(--md-sys-color-primary);
}

/* -- NEW Authentication Layout */
.auth-layout {
    display: grid;
    grid-template-columns: 3fr 4fr;
    min-height: 100vh;
    width: 100%;
}

.auth-layout__brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 64px;
    background: radial-gradient(circle at 20% 30%, var(--md-sys-color-primary-container), var(--md-sys-color-background) 80%);
}

.brand-identity__logo {
    font-family: var(--md-sys-typescale-display-large-font);
    font-size: 52px;
    font-weight: var(--md-sys-typescale-display-large-weight);
    line-height: 1.1;
    color: #fff; /* Brighter than on-primary-container */
}

.brand-identity__tagline {
    margin-top: 16px;
    font-family: var(--md-sys-typescale-title-large-font);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: 400;
    color: var(--md-sys-color-primary);
    opacity: 0.9;
}

.auth-layout__form-panel {
    display: grid;
    place-items: center;
    padding: 32px;
    background-color: var(--md-sys-color-surface);
}

/* -- REFINED: Responsive adjustments -- */
@media (max-width: 960px) {
    .auth-layout {
        /* Change to a single-column grid where children can overlap */
        grid-template-columns: 1fr;
        display: grid;
    }

    .auth-layout__brand-panel {
        /* This panel becomes the full-screen background layer */
        grid-row: 1 / 2;
        grid-column: 1 / 2;
        min-height: 100vh; /* Ensure it covers the full viewport height */
        align-items: center; /* Center logo horizontally */
        justify-content: flex-start; /* Push logo towards the top */
        text-align: center;
        padding: 32px;
        padding-top: 8vh; /* Give breathing room from the top edge */
    }

    .auth-layout__form-panel {
        /* This panel overlays the brand panel */
        grid-row: 1 / 2;
        grid-column: 1 / 2;
        background-color: transparent; /* Make it see-through to the brand panel below */
        display: grid;
        place-items: center;
        padding: 16px; /* Reduce padding for smaller screens */
        align-content: center; /* Ensure vertical centering */
    }
}

/* -- Material Symbols Base Styles (From The Bible) */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle; /* Better alignment with text */
}

/* -- Typography Helper Classes */
.m3-headline-medium {
    font-family: var(--md-sys-typescale-headline-medium-font);
    font-size: var(--md-sys-typescale-headline-medium-size);
    font-weight: var(--md-sys-typescale-headline-medium-weight);
    line-height: var(--md-sys-typescale-headline-medium-line-height);
}

.m3-title-large {
    font-family: var(--md-sys-typescale-title-large-font);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: var(--md-sys-typescale-title-large-weight);
    line-height: var(--md-sys-typescale-title-large-line-height);
}

.m3-label-large {
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    line-height: var(--md-sys-typescale-label-large-line-height);
    letter-spacing: 0.1px;
}

.m3-body-large {
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    font-weight: var(--md-sys-typescale-body-large-weight);
    line-height: var(--md-sys-typescale-body-large-line-height);
}

.m3-body-medium {
    font-family: var(--md-sys-typescale-body-medium-font);
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: var(--md-sys-typescale-body-medium-weight);
    line-height: var(--md-sys-typescale-body-medium-line-height);
}