/* =========================================
   EMERRIMENT AUTHENTICATION
   Phase A — Authentication Foundation
========================================= */

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

:root {
    --em-green: #355c4a;
    --em-green-dark: #264638;
    --em-gold: #d4af37;
    --em-beige: #f7f2e8;
    --em-cream: #fffdf8;
    --em-text: #2f2f2f;
    --em-muted: #777;
    --em-border: #e5e0d6;
    --em-error: #c0392b;
    --em-success: #2e7d32;
}

body {
    min-height: 100vh;
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background:
        linear-gradient(
            135deg,
            var(--em-beige),
            #ffffff
        );

    color: var(--em-text);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;
}


/* =========================================
   AUTH CONTAINER
========================================= */

.auth-container {
    width: 100%;
    max-width: 1050px;

    min-height: 650px;

    background: var(--em-cream);

    border-radius: 24px;

    overflow: hidden;

    display: grid;
    grid-template-columns: 1fr 1fr;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.10);
}


/* =========================================
   BRAND PANEL
========================================= */

.auth-brand {
    background:
        linear-gradient(
            145deg,
            var(--em-green-dark),
            var(--em-green)
        );

    color: white;

    padding: 55px 45px;

    display: flex;
    flex-direction: column;

    justify-content: center;

    position: relative;

    overflow: hidden;
}

.auth-brand::before {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    border-radius: 50%;

    background:
        rgba(212, 175, 55, 0.12);

    top: -100px;
    right: -100px;
}

.auth-brand::after {
    content: "";

    position: absolute;

    width: 220px;
    height: 220px;

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.05);

    bottom: -100px;
    left: -80px;
}

.brand-logo {
    font-size: 30px;
    font-weight: 700;

    margin-bottom: 25px;

    position: relative;
    z-index: 2;
}

.brand-logo span {
    color: var(--em-gold);
}

.auth-brand h1 {
    font-size: 42px;

    line-height: 1.15;

    margin-bottom: 20px;

    position: relative;
    z-index: 2;
}

.auth-brand p {
    max-width: 420px;

    font-size: 16px;

    line-height: 1.8;

    color: rgba(255,255,255,0.85);

    position: relative;
    z-index: 2;
}

.brand-message {
    margin-top: 35px;

    padding: 18px;

    border-left:
        3px solid var(--em-gold);

    color: rgba(255,255,255,0.85);

    line-height: 1.7;

    position: relative;
    z-index: 2;
}


/* =========================================
   FORM PANEL
========================================= */

.auth-form-panel {
    padding: 55px 50px;

    display: flex;

    flex-direction: column;

    justify-content: center;
}

.auth-form-panel h2 {
    font-size: 30px;

    margin-bottom: 10px;

    color: var(--em-green-dark);
}

.auth-subtitle {
    color: var(--em-muted);

    margin-bottom: 30px;

    line-height: 1.6;
}


/* =========================================
   FORM GROUP
========================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: 600;

    color: var(--em-text);
}

.form-group input {
    width: 100%;

    padding: 14px 16px;

    border:
        1px solid var(--em-border);

    border-radius: 10px;

    background: white;

    font-size: 15px;

    outline: none;

    transition:
        border-color .2s,
        box-shadow .2s;
}

.form-group input:focus {
    border-color:
        var(--em-gold);

    box-shadow:
        0 0 0 3px
        rgba(212,175,55,0.12);
}


/* =========================================
   PASSWORD WRAPPER
========================================= */

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 75px;
}

.toggle-password {
    position: absolute;

    right: 12px;
    top: 50%;

    transform: translateY(-50%);

    border: none;

    background: transparent;

    color: var(--em-green);

    cursor: pointer;

    font-size: 13px;
}


/* =========================================
   MAIN BUTTON
========================================= */

.auth-button {
    width: 100%;

    padding: 15px;

    border: none;

    border-radius: 10px;

    background:
        var(--em-green);

    color: white;

    font-size: 16px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background .2s,
        transform .2s;
}

.auth-button:hover {
    background:
        var(--em-green-dark);

    transform:
        translateY(-1px);
}

.auth-button:disabled {
    opacity: .6;

    cursor: not-allowed;

    transform: none;
}


/* =========================================
   LINKS
========================================= */

.auth-links {
    margin-top: 22px;

    text-align: center;

    font-size: 14px;

    color: var(--em-muted);
}

.auth-links a {
    color: var(--em-green);

    font-weight: 600;

    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}


/* =========================================
   FORGOT PASSWORD
========================================= */

.forgot-password {
    display: block;

    text-align: right;

    margin-top: -10px;

    margin-bottom: 20px;

    font-size: 13px;

    color: var(--em-green);

    text-decoration: none;
}


/* =========================================
   MESSAGE
========================================= */

.auth-message {
    display: none;

    margin-bottom: 20px;

    padding: 13px 15px;

    border-radius: 9px;

    font-size: 14px;

    line-height: 1.5;
}

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

.auth-message.error {
    background: #fdecea;

    color: var(--em-error);
}

.auth-message.success {
    background: #edf7ee;

    color: var(--em-success);
}


/* =========================================
   DIVIDER
========================================= */

.auth-divider {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 25px 0;

    color: #aaa;

    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background:
        var(--em-border);
}


/* =========================================
   CHECKBOX
========================================= */

.checkbox-group {
    display: flex;

    align-items: flex-start;

    gap: 9px;

    margin-bottom: 20px;

    font-size: 13px;

    line-height: 1.5;

    color: var(--em-muted);
}

.checkbox-group input {
    margin-top: 3px;

    accent-color:
        var(--em-green);
}


/* =========================================
   LOADING
========================================= */

.loading-spinner {
    width: 18px;
    height: 18px;

    border:
        2px solid
        rgba(255,255,255,.4);

    border-top-color:
        white;

    border-radius: 50%;

    display: inline-block;

    animation:
        authSpin .7s linear infinite;

    vertical-align: middle;

    margin-right: 7px;
}

@keyframes authSpin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================================
   DASHBOARD AUTH STATE
========================================= */

.auth-protected {
    min-height: 100vh;

    width: 100%;

    background:
        var(--em-beige);
}

.auth-loading {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    color: var(--em-green);
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 800px) {

    body {
        padding: 15px;
    }

    .auth-container {
        grid-template-columns: 1fr;

        min-height: auto;

        max-width: 520px;
    }

    .auth-brand {
        padding: 35px 30px;

        min-height: 300px;
    }

    .auth-brand h1 {
        font-size: 32px;
    }

    .brand-message {
        display: none;
    }

    .auth-form-panel {
        padding: 35px 25px;
    }

}


/* =========================================
   SMALL PHONES
========================================= */

@media (max-width: 400px) {

    body {
        padding: 8px;
    }

    .auth-container {
        border-radius: 16px;
    }

    .auth-brand {
        padding: 30px 22px;
    }

    .auth-brand h1 {
        font-size: 28px;
    }

    .auth-form-panel {
        padding: 30px 20px;
    }

    .auth-form-panel h2 {
        font-size: 26px;
    }

}