:root {
    /* Material Design 3 Color Tokens - ECOS Brand Theme */
    --md-sys-color-primary: HSL(203, 86%, 22%);
    --md-sys-color-on-primary: HSL(0, 0%, 100%);
    --md-sys-color-primary-container: HSL(203, 86%, 92%);
    --md-sys-color-on-primary-container: HSL(203, 95%, 15%);
    --md-sys-color-secondary: HSL(120, 60%, 25%);
    --md-sys-color-on-secondary: HSL(0, 0%, 100%);
    --md-sys-color-secondary-container: HSL(120, 40%, 90%);
    --md-sys-color-on-secondary-container: HSL(120, 60%, 25%);
    --md-sys-color-error: HSL(0, 75%, 40%);
    --md-sys-color-on-error: HSL(0, 0%, 100%);
    --md-sys-color-error-container: HSL(0, 85%, 95%);
    --md-sys-color-on-error-container: HSL(0, 90%, 15%);
    --md-sys-color-background: HSL(203, 15%, 98%);
    --md-sys-color-on-background: HSL(203, 30%, 12%);
    --md-sys-color-surface: HSL(0, 0%, 100%);
    --md-sys-color-on-surface: HSL(203, 30%, 12%);
    --md-sys-color-surface-variant: HSL(203, 10%, 94%);
    --md-sys-color-on-surface-variant: HSL(203, 15%, 35%);
    --md-sys-color-outline: HSL(203, 10%, 75%);
    --md-sys-color-outline-variant: HSL(203, 12%, 88%);
    
    /* Typography */
    --md-sys-typescale-font: 'Roboto', sans-serif;
    
    /* Elevations */
    --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30);
    --md-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--md-sys-typescale-font);
    background-color: var(--md-sys-color-background);
    background-image: url('../images/ecosLogo.jpeg');
    background-size: 180px 180px;
    background-position: center top 40px;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 20px 90px 20px;
    padding-top: 140px;
    position: relative;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Bottom Navbar */
.bottom-navbar {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    width: calc(100% - 32px);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 8px;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1000;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 12px;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.nav-btn.active {
    color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-primary-container);
    font-weight: 600;
}

.nav-btn .material-symbols-outlined {
    font-size: 24px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: -1;
}

.login-container {
    background-color: var(--md-sys-color-surface);
    border-radius: 28px;
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: var(--md-elevation-1);
    width: 100%;
    max-width: 400px;
    padding: 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    color: var(--md-sys-color-on-background);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

label {
    font-size: 12px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

input[type="text"],
input[type="password"] {
    font-family: var(--md-sys-typescale-font);
    padding: 12px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 48px !important;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.password-toggle-btn:hover {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

.password-toggle-btn .material-symbols-outlined {
    font-size: 22px;
    user-select: none;
}

.login-btn {
    font-family: var(--md-sys-typescale-font);
    font-size: 14px;
    font-weight: 500;
    border-radius: 100px;
    width: 100%;
    padding: 12px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    margin-top: 8px;
}

.login-btn:hover:not(:disabled) {
    background-color: HSL(203, 86%, 15%);
    box-shadow: var(--md-elevation-1);
}

.login-btn:disabled {
    background-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    cursor: not-allowed;
    opacity: 0.5;
}

.error-message {
    background-color: var(--md-sys-color-error-container);
    color: var(--md-sys-color-on-error-container);
    border: 1px solid var(--md-sys-color-error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: 1px solid var(--md-sys-color-primary);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
}

.loading {
    width: 16px;
    height: 16px;
    border: 2px solid var(--md-sys-color-on-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
}

.form-link a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.form-link a:hover {
    color: HSL(120, 60%, 25%);
    text-decoration: underline;
}

@media (max-width: 480px) {
    body {
        padding: 0 0 100px 0;
        padding-top: 140px;
        background-color: var(--md-sys-color-surface);
    }

    .bottom-navbar {
        padding: 8px 4px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        width: calc(100% - 16px);
        border-radius: 20px;
    }

    .nav-btn {
        padding: 6px 4px;
        font-size: 10px;
    }

    .nav-btn .material-symbols-outlined {
        font-size: 20px;
    }
    
    body::before {
        background-color: var(--md-sys-color-surface);
    }
    
    .login-container {
        border-radius: 0;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        padding: 20px 16px;
        border: none;
    }
}
