:root {
    --ink: #e8f0eb;
    --muted: #9aaca0;
    --paper: #0d1410;
    --surface: #151f19;
    --surface-raised: #1c2a21;
    --input: #101912;
    --green: #83d39c;
    --green-dark: #b7efc5;
    --line: #2b4032;
    --error: #ff9c91;
    --success: #93e0a8;
    --shadow: rgba(0, 0, 0, 0.26);
}

:root[data-theme="light"] {
    --ink: #17211b;
    --muted: #66736a;
    --paper: #f2f5f1;
    --surface: #ffffff;
    --surface-raised: #f7faf7;
    --input: #ffffff;
    --green: #2f7650;
    --green-dark: #1f5137;
    --line: #d8e2da;
    --error: #a23d32;
    --success: #286b49;
    --shadow: rgba(30, 50, 38, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--paper);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 0% 0%, rgba(77, 151, 99, 0.2), transparent 32rem),
        radial-gradient(circle at 100% 100%, rgba(157, 107, 67, 0.14), transparent 28rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: color 180ms ease, background-color 180ms ease;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.page {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
    padding: 76px 0 48px;
}

.auth-card,
.card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 24px 70px var(--shadow);
}

.auth-card {
    width: min(450px, 100%);
    margin: 8vh auto 0;
    padding: 38px;
}

.auth-mark {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 25px;
    place-items: center;
    border-radius: 15px;
    color: #07110a;
    background: var(--green);
    box-shadow: 0 10px 25px color-mix(in srgb, var(--green) 25%, transparent);
    font-size: 1.5rem;
    font-weight: 900;
}

.auth-card h1 {
    font-size: clamp(2.5rem, 8vw, 4.3rem);
}

.auth-card form {
    margin-top: 30px;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 68px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    padding: 5px 7px;
    color: var(--muted);
    background: transparent;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 800;
}

.password-toggle:hover {
    color: var(--green-dark);
}

.auth-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 0.73rem;
    text-align: center;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--muted);
    font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.sso-button {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 19px;
    color: var(--ink);
    background: var(--surface-raised);
    font-size: 0.88rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.sso-button:hover {
    border-color: var(--green);
    color: var(--green-dark);
}

.card {
    padding: 28px;
    margin-bottom: 20px;
}

.topbar,
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.topbar {
    margin-bottom: 32px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 680px;
    margin-bottom: 12px;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 0.92;
    letter-spacing: -0.07em;
}

h2 {
    margin-bottom: 10px;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--green);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.muted {
    color: var(--muted);
    line-height: 1.65;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: grid;
    gap: 9px;
    margin-bottom: 20px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    color: var(--ink);
    background: var(--input);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent);
}

small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
}

button[type="submit"] {
    border-radius: 12px;
    padding: 13px 19px;
    color: #07110a;
    background: var(--green);
    font-size: 0.88rem;
    font-weight: 800;
    transition: transform 160ms ease, background 160ms ease;
}

button[type="submit"]:hover {
    background: var(--green-dark);
    transform: translateY(-1px);
}

.button-secondary,
.theme-toggle {
    color: var(--ink);
    background: var(--surface-raised);
    border: 1px solid var(--line);
}

.button-secondary {
    border-radius: 12px;
    padding: 11px 15px;
    font-size: 0.84rem;
    font-weight: 700;
}

.theme-toggle {
    position: fixed;
    z-index: 2;
    top: 18px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 9px 13px;
    box-shadow: 0 8px 24px var(--shadow);
    font-size: 0.78rem;
    font-weight: 800;
}

.theme-toggle:hover,
.button-secondary:hover {
    color: var(--green-dark);
    border-color: var(--green);
}

.theme-icon {
    font-size: 1rem;
    line-height: 1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
    accent-color: var(--green);
}

.alert {
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
    font-size: 0.88rem;
}

.alert.error {
    display: flex;
    align-items: center;
    gap: 9px;
}

.alert.error {
    color: var(--error);
    background: color-mix(in srgb, #7a3028 25%, var(--surface));
}

.alert.success {
    color: var(--success);
    background: color-mix(in srgb, #286b49 22%, var(--surface));
}

.status-pill {
    display: inline-block;
    border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
    border-radius: 999px;
    padding: 7px 11px;
    color: var(--green-dark);
    background: color-mix(in srgb, var(--green) 13%, var(--surface));
    font-size: 0.72rem;
    font-weight: 800;
}

@media (max-width: 700px) {
    .page {
        width: min(100% - 28px, 560px);
        padding-top: 72px;
    }

    .grid {
        display: block;
    }

    .topbar,
    .section-heading {
        display: block;
    }

    .topbar form {
        margin-top: 20px;
    }

    .auth-card,
    .card {
        padding: 22px;
        border-radius: 18px;
    }

    .theme-toggle {
        top: 12px;
        right: 14px;
    }
}
