:root {
    --bg: #f4efe7;
    --surface: #fffaf4;
    --surface-strong: #ffffff;
    --ink: #151d29;
    --ink-soft: #4f5a67;
    --ink-faint: #7a8592;
    --line: rgba(21, 29, 41, 0.1);
    --line-strong: rgba(21, 29, 41, 0.16);
    --accent: #b77a4d;
    --accent-soft: #e7c8ad;
    --accent-deep: #8c5a35;
    --success: #215f4a;
    --success-bg: #e1f2ea;
    --error: #8b2f3b;
    --error-bg: #fdecef;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 24px 60px rgba(16, 24, 38, 0.12);
    --font-ui: "Avenir Next", "Segoe UI", sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", serif;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(183, 122, 77, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f2eb 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: var(--font-ui);
    line-height: 1.45;
}

body,
input,
textarea,
select,
button {
    font-family: var(--font-ui);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 242, 235, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(21, 29, 41, 0.06);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.topbar-link {
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 0.92rem;
}

.brand-mark__dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #efd8c2 100%);
    box-shadow: 0 0 0 8px rgba(183, 122, 77, 0.08);
}

.brand-mark--light {
    color: #f4efe7;
}

.flash-stack {
    width: min(1180px, calc(100% - 2rem));
    margin: 0.8rem auto 0;
    display: grid;
    gap: 0.6rem;
}

.alert {
    border-radius: 16px;
    padding: 0.8rem 0.95rem;
    font-size: 0.88rem;
    border: 1px solid transparent;
}

.alert--success {
    color: var(--success);
    background: var(--success-bg);
    border-color: rgba(33, 95, 74, 0.16);
}

.alert--error {
    color: var(--error);
    background: var(--error-bg);
    border-color: rgba(139, 47, 59, 0.12);
}

.page-shell {
    width: min(1280px, calc(100% - 2rem));
    margin: 0.9rem auto 2.2rem;
}

.page-shell--narrow {
    width: min(860px, calc(100% - 2rem));
}

.intake-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
    gap: 1rem;
}

.intake-aside {
    min-width: 0;
}

.poster-panel {
    position: sticky;
    top: 5.7rem;
    padding: 1.45rem;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(240, 214, 191, 0.22), transparent 36%),
        linear-gradient(160deg, #101826 0%, #172235 65%, #22344b 100%);
    color: #f8f2ea;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.poster-kicker,
.card-head__eyebrow,
.admin-hero__eyebrow,
.section-heading__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.66rem;
    color: var(--accent);
    margin-bottom: 0.45rem;
}

.poster-panel .poster-kicker {
    color: #f3d8be;
}

.poster-title {
    font-family: var(--font-display);
    font-size: clamp(1.95rem, 3.2vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    max-width: 11ch;
    margin-bottom: 0.7rem;
}

.poster-title--compact {
    max-width: 16ch;
    font-size: clamp(1.8rem, 4vw, 2.55rem);
}

.poster-lede {
    max-width: 46ch;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(248, 242, 234, 0.76);
}

.poster-points {
    display: grid;
    gap: 0.8rem;
    margin: 1.15rem 0;
}

.poster-point {
    padding-top: 0.8rem;
    border-top: 1px solid rgba(248, 242, 234, 0.14);
}

.poster-point__label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.22rem;
    font-size: 0.9rem;
}

.poster-point__text {
    color: rgba(248, 242, 234, 0.72);
    font-size: 0.86rem;
}

.notice-banner {
    margin: 1rem 0;
    background: rgba(255, 243, 230, 0.12);
    border: 1px solid rgba(231, 200, 173, 0.25);
    border-radius: 16px;
    padding: 0.8rem 0.9rem;
    color: #f7e8d8;
    line-height: 1.5;
    font-size: 0.86rem;
}

.progress-card {
    padding: 0.8rem 0.9rem;
    border-radius: 18px;
    background: rgba(248, 242, 234, 0.08);
    border: 1px solid rgba(248, 242, 234, 0.12);
    margin: 1rem 0 0.8rem;
}

.progress-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    margin-bottom: 0.6rem;
}

.progress-card__note {
    margin: 0.55rem 0 0;
    color: rgba(248, 242, 234, 0.66);
    font-size: 0.76rem;
}

.progress-card__note[data-state="saved"],
.progress-card__note[data-state="restored"],
.progress-card__note[data-state="ready"] {
    color: #f3d8be;
}

.progress-card__note[data-state="error"] {
    color: #ffd7db;
}

.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(248, 242, 234, 0.16);
    overflow: hidden;
}

.progress-bar__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d9b08e 0%, #f5deca 100%);
    transition: width 180ms ease-out;
}

.step-nav {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.step-nav__link {
    display: grid;
    grid-template-columns: 2.55rem 1fr;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border-radius: 16px;
    color: rgba(248, 242, 234, 0.7);
    border: 1px solid transparent;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
    font-size: 0.87rem;
}

.step-nav__link span:first-child {
    color: #f3d8be;
    font-weight: 700;
}

.step-nav__link:hover,
.step-nav__link.is-active {
    transform: translateX(4px);
    background: rgba(248, 242, 234, 0.08);
    border-color: rgba(248, 242, 234, 0.12);
    color: #ffffff;
}

.resume-card {
    margin-top: 0.95rem;
    padding: 0.95rem;
    border-radius: 18px;
    background: rgba(248, 242, 234, 0.07);
    border: 1px solid rgba(248, 242, 234, 0.12);
    display: grid;
    gap: 0.75rem;
}

.resume-card__eyebrow {
    margin: 0;
    color: #f3d8be;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.66rem;
}

.resume-card__text,
.resume-card__status {
    margin: 0;
    color: rgba(248, 242, 234, 0.72);
    font-size: 0.82rem;
    line-height: 1.45;
}

.resume-card__status[data-state="saving"],
.resume-card__status[data-state="sent"],
.resume-card__status[data-state="copied"],
.resume-card__status[data-state="saved"] {
    color: #f3d8be;
}

.resume-card__status[data-state="error"] {
    color: #ffd7db;
}

.resume-card .field-label {
    color: #f8f2ea;
}

.resume-card .field-input {
    background: rgba(255, 255, 255, 0.9);
}

.resume-card__actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.intake-main {
    min-width: 0;
}

.questionnaire-form {
    display: grid;
    gap: 0.95rem;
}

.form-section,
.confirmation-panel,
.login-panel,
.admin-card,
.admin-hero {
    background: rgba(255, 250, 244, 0.78);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 18px 48px rgba(22, 32, 46, 0.06);
}

.form-section {
    padding: 1.25rem;
    position: relative;
}

.form-section[hidden] {
    display: none !important;
}

.form-section::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(183, 122, 77, 0.08), transparent 68%);
    pointer-events: none;
}

.section-heading {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 0.8rem;
    align-items: start;
    margin-bottom: 1rem;
}

.section-heading__index {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #1d2a3b 0%, #101826 100%);
    color: #f5dfcd;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.section-heading h2,
.admin-hero h1,
.card-head h2 {
    font-size: clamp(1.2rem, 1.8vw, 1.65rem);
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.section-heading p,
.admin-hero p,
.card-head p,
.confirmation-panel .poster-lede,
.login-panel .poster-lede {
    color: var(--ink-soft);
    line-height: 1.5;
    font-size: 0.9rem;
}

.form-grid,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field--wide {
    grid-column: 1 / -1;
}

.field-label {
    font-weight: 700;
    font-size: 0.84rem;
}

.field-required {
    color: var(--accent-deep);
}

.field-help {
    color: var(--ink-faint);
    font-size: 0.78rem;
    line-height: 1.4;
}

.field-error {
    color: var(--error);
    font-size: 0.8rem;
    margin: 0;
}

.field-input {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    border-radius: 14px;
    padding: 0.72rem 0.85rem;
    font-size: 0.9rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-input:focus {
    outline: none;
    border-color: rgba(183, 122, 77, 0.55);
    box-shadow: 0 0 0 4px rgba(183, 122, 77, 0.12);
    background: #ffffff;
}

.field-input--textarea {
    min-height: 86px;
    resize: vertical;
    line-height: 1.45;
}

select.field-input {
    appearance: none;
}

.field--error .field-input {
    border-color: rgba(139, 47, 59, 0.4);
    background: #fff9fa;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem;
}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.7rem 0.8rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.88rem;
}

.choice input {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 20px;
    background: linear-gradient(145deg, #131d2b 0%, #22344b 100%);
    color: #f8f2ea;
}

.form-footer__title {
    font-size: 0.96rem;
    margin-bottom: 0.25rem;
}

.form-footer__text {
    color: rgba(248, 242, 234, 0.72);
    margin-bottom: 0;
    font-size: 0.85rem;
}

.section-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(21, 29, 41, 0.08);
}

.section-actions__meta {
    margin: 0;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
}

.section-actions__buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.68rem 1.05rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent) 0%, #d39a72 100%);
    color: #fffaf4;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
    box-shadow: 0 12px 26px rgba(183, 122, 77, 0.2);
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button--secondary {
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    border-color: var(--line);
    box-shadow: none;
}

.button--danger {
    background: linear-gradient(135deg, #ba6570 0%, #9d4452 100%);
    color: #fffaf4;
    box-shadow: 0 12px 26px rgba(157, 68, 82, 0.18);
}

.button--ghost {
    background: transparent;
    border-color: rgba(248, 242, 234, 0.14);
    color: #f8f2ea;
    box-shadow: none;
}

.text-link {
    color: var(--accent-deep);
    font-weight: 700;
}

.text-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-deep);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.text-link-button--danger {
    color: #9d4452;
}

.hero-actions,
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.confirmation-panel,
.login-panel {
    padding: 1.5rem;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    padding: 0.8rem 0 1rem;
    margin: 0.8rem 0 1.1rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.summary-strip__label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.66rem;
    color: var(--ink-faint);
    margin-bottom: 0.35rem;
}

.login-form {
    display: grid;
    gap: 0.85rem;
}

.admin-body {
    background: #eff1f3;
}

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.15rem;
    background: linear-gradient(180deg, #101826 0%, #172235 100%);
    color: #f8f2ea;
    display: grid;
    align-content: start;
    gap: 1rem;
}

.admin-user {
    border-top: 1px solid rgba(248, 242, 234, 0.12);
    border-bottom: 1px solid rgba(248, 242, 234, 0.12);
    padding: 0.8rem 0;
}

.admin-user__label {
    color: rgba(248, 242, 234, 0.58);
    font-size: 0.74rem;
    margin-bottom: 0.25rem;
}

.admin-user__value {
    font-weight: 700;
    font-size: 0.92rem;
}

.admin-nav {
    display: grid;
    gap: 0.25rem;
}

.admin-nav__link {
    padding: 0.65rem 0.75rem;
    border-radius: 14px;
    color: rgba(248, 242, 234, 0.76);
    border: 1px solid transparent;
    font-size: 0.88rem;
}

.admin-nav__link.is-active,
.admin-nav__link:hover {
    background: rgba(248, 242, 234, 0.08);
    border-color: rgba(248, 242, 234, 0.12);
    color: #ffffff;
}

.logout-form {
    margin-top: auto;
}

.admin-main {
    padding: 1.15rem;
    min-width: 0;
}

.admin-hero,
.admin-card {
    padding: 1.1rem;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.admin-hero p {
    max-width: 58ch;
    margin-bottom: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(21, 29, 41, 0.08);
    box-shadow: 0 18px 48px rgba(22, 32, 46, 0.04);
}

.stat-card strong {
    display: block;
    font-size: 1.65rem;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.stat-card__label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.66rem;
}

.card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.stack-list {
    display: grid;
    gap: 0.8rem;
}

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

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

.data-table th,
.data-table td {
    padding: 0.65rem 0.55rem;
    border-bottom: 1px solid rgba(21, 29, 41, 0.08);
    text-align: left;
    vertical-align: top;
    font-size: 0.88rem;
}

.data-table th {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.64rem;
    color: var(--ink-faint);
}

.data-table td span,
.data-table td strong {
    display: block;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.inline-action-form {
    display: inline;
    margin: 0;
}

.link-preview {
    word-break: break-all;
}

.detail-grid {
    margin-top: 0.8rem;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0.15rem 0.58rem;
    border-radius: 999px;
    background: rgba(183, 122, 77, 0.12);
    color: var(--accent-deep);
    font-size: 0.76rem;
    font-weight: 700;
}

.empty-state {
    color: var(--ink-faint);
    margin: 0.25rem 0 0;
}

.prose-block {
    line-height: 1.55;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.info-list {
    display: grid;
    gap: 0.75rem;
}

.info-list__row {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(0, 1fr);
    gap: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(21, 29, 41, 0.08);
}

.info-list__row:first-child {
    border-top: 0;
    padding-top: 0;
}

.info-list__row span {
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.66rem;
}

.info-list__row strong {
    font-weight: 500;
    line-height: 1.55;
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .intake-shell,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .poster-panel,
    .admin-sidebar {
        position: static;
        height: auto;
    }

    .admin-sidebar {
        gap: 1rem;
    }

    .admin-main {
        padding-top: 0;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .topbar,
    .form-footer,
    .section-actions,
    .admin-hero,
    .card-head,
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .detail-grid,
    .summary-strip,
    .stat-grid,
    .info-list__row {
        grid-template-columns: 1fr;
    }

    .section-heading {
        grid-template-columns: 1fr;
    }

    .section-heading__index {
        width: 52px;
        height: 52px;
    }

    .poster-panel,
    .form-section,
    .confirmation-panel,
    .login-panel,
    .admin-card,
    .admin-hero {
        padding: 1rem;
        border-radius: 18px;
    }

    .page-shell,
    .flash-stack {
        width: calc(100% - 1rem);
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }

    .section-actions__buttons {
        width: 100%;
    }

    .section-actions__buttons .button {
        width: 100%;
    }

    .resume-card__actions .button {
        width: 100%;
    }
}
