:root {
    color-scheme: light;
    --ink: #13281f;
    --muted: #5b6c64;
    --surface: #f7f6f0;
    --brand: #176b45;
    --brand-dark: #0d4b30;
    --accent: #d5a72f;
    --line: #dce2dc;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--surface);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 5%, rgba(213, 167, 47, 0.13), transparent 28rem),
        linear-gradient(180deg, #fbfaf5 0%, var(--surface) 100%);
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(23, 107, 69, 0.35);
    outline-offset: 3px;
}

.landing-shell {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 3rem;
    flex-direction: column;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 5rem;
    padding: 0.85rem clamp(1rem, 3vw, 3rem);
    gap: 1.25rem;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 250, 245, 0.96);
    backdrop-filter: blur(12px);
}

.app-nav {
    display: flex;
    flex: 1;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.app-nav a {
    padding: 0.55rem 0.7rem;
    border-radius: 0.45rem;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.app-nav a:hover,
.app-nav a.active {
    color: var(--brand-dark);
    background: #e9f2ed;
}

.nav-logout,
.primary-action,
.secondary-action {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--brand-dark);
    border-radius: 0.45rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.nav-logout,
.secondary-action {
    color: var(--brand-dark);
    background: transparent;
}

.primary-action {
    color: white;
    background: var(--brand-dark);
}

button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.app-page,
.account-shell {
    width: min(88rem, 100%);
    margin: 0 auto;
    padding: 2rem clamp(1rem, 3vw, 3rem) 3rem;
}

.account-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.account-card {
    width: min(30rem, 100%);
    padding: clamp(1.5rem, 5vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: white;
    box-shadow: 0 1.5rem 4rem rgba(19, 40, 31, 0.12);
}

.app-page h1,
.account-card h1,
.workspace h1 {
    max-width: none;
    font-size: clamp(2rem, 5vw, 3.75rem);
    line-height: 1.02;
}

.account-card h1 {
    margin-bottom: 1rem;
}

.page-heading {
    margin-bottom: 1.5rem;
}

.page-heading p:not(.eyebrow) {
    max-width: 48rem;
    color: var(--muted);
}

.panel {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    background: white;
    box-shadow: 0 0.3rem 1.25rem rgba(23, 63, 53, 0.07);
}

.panel h2 {
    margin-top: 0;
}

.form-grid {
    display: grid;
    margin-bottom: 1rem;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.form-field {
    display: grid;
    gap: 0.35rem;
}

.form-field label,
.form-field legend,
.account-card label {
    font-size: 0.9rem;
    font-weight: 700;
}

.form-field input:not([type="checkbox"]),
.form-field select,
.form-field textarea,
.account-card input:not([type="checkbox"]),
.sensitive-panel textarea {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #9fb3a9;
    border-radius: 0.45rem;
    background: white;
    font: inherit;
}

.role-options {
    margin: 0;
    padding: 0;
    border: 0;
}

.role-options label {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    font-weight: 500;
}

.notice {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.55rem;
    color: #195739;
    background: #dcefe4;
}

.responsive-table {
    overflow-x: auto;
}

.responsive-table table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
    padding: 0.7rem 0.55rem;
    border-bottom: 1px solid #e2e9e5;
    text-align: left;
    vertical-align: top;
}

.responsive-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-header {
    display: flex;
    min-height: 6.5rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: 0.75rem 0.25rem 0.75rem 0.25rem;
    color: white;
    background: var(--brand);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.brand small {
    margin-top: 0.12rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.phase-badge {
    padding: 0.5rem 0.75rem;
    border: 1px solid #bfd3c8;
    border-radius: 999px;
    color: var(--brand-dark);
    background: #edf6f0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.hero {
    display: grid;
    flex: 1;
    grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 0.75fr);
    gap: clamp(3rem, 8vw, 8rem);
    align-items: center;
    padding: 5rem 0;
}

.eyebrow,
.card-kicker {
    margin: 0 0 1rem;
    color: var(--brand);
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1 {
    max-width: 13ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 6.4vw, 6.4rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.96;
}

h1:focus {
    outline: none;
}

.hero-copy {
    max-width: 43rem;
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
}

.status-row {
    display: flex;
    margin-top: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #3f5349;
    font-size: 0.85rem;
    font-weight: 650;
}

.status-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.status-row i {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #2b9d63;
    box-shadow: 0 0 0 4px rgba(43, 157, 99, 0.12);
}

.foundation-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.75rem, 3vw, 2.75rem);
    border: 1px solid rgba(19, 40, 31, 0.12);
    border-radius: 0.45rem;
    color: #f8f7f2;
    background: var(--ink);
    box-shadow: 0 1.75rem 4rem rgba(19, 40, 31, 0.16);
}

.foundation-card::after {
    position: absolute;
    right: -3rem;
    bottom: -4rem;
    width: 10rem;
    height: 10rem;
    border: 1.5rem solid rgba(213, 167, 47, 0.16);
    border-radius: 50%;
    content: "";
}

.foundation-card .card-kicker {
    color: #efd479;
}

.foundation-card h2 {
    max-width: 14ch;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    font-weight: 500;
    line-height: 1.08;
}

.foundation-card ul {
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.foundation-card li {
    position: relative;
    padding: 0.65rem 0 0.65rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    color: #cbd7d1;
    font-size: 0.9rem;
}

.foundation-card li::before {
    position: absolute;
    top: 1rem;
    left: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

.foundation-card a {
    position: relative;
    z-index: 1;
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    color: #fff5cf;
    font-size: 0.85rem;
    font-weight: 750;
    text-underline-offset: 0.25rem;
}

footer {
    display: flex;
    min-height: 4.5rem;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.75rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #b32121;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

@media (max-width: 850px) {
    .app-header {
        position: static;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .app-nav {
        order: 3;
        width: 100%;
    }

    .app-header > form {
        margin-left: auto;
    }

    .landing-shell {
        padding: 0 1.5rem;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 3.5rem;
        padding: 4rem 0;
    }

    .foundation-card {
        max-width: 34rem;
    }
}

@media (max-width: 520px) {
    .site-header {
        min-height: 5.5rem;
    }

    .phase-badge {
        max-width: 8.5rem;
        text-align: center;
    }

    .brand small {
        display: none;
    }

    .hero {
        padding-top: 3rem;
    }

    h1 {
        font-size: clamp(2.75rem, 15vw, 4.25rem);
    }

    .status-row {
        gap: 0.9rem;
    }

    footer {
        align-items: flex-start;
        padding: 1.25rem 0;
        flex-direction: column;
        justify-content: center;
        gap: 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
