:root {
    --forest: #243B36;
    --dark-forest: #18211F;
    --ivory: #F7F2EA;
    --paper: #FFFDF8;
    --sage: #83978E;
    --sage-soft: #DDE6DC;
    --gold: #B9965A;
    --sand: #D8C7AD;
    --ink: #25322F;
    --muted: #6B6F69;
    --line: rgba(36, 59, 54, .14);
    --shadow: 0 18px 42px rgba(36, 59, 54, .08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

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

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.serif,
h1,
h2,
h3,
.brand-name {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 248, .92);
    backdrop-filter: blur(16px);
}

.nav-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    font-weight: 700;
    color: var(--forest);
    min-width: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: conic-gradient(from 40deg, var(--forest), var(--forest) 58%, var(--gold) 58%, var(--gold) 74%, var(--forest) 74%);
    position: relative;
    flex: 0 0 auto;
}

.brand-mark::after {
    content: "";
    position: absolute;
    inset: 8px 10px;
    border-radius: 50%;
    background: var(--paper);
}

.brand-name {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 270px;
    max-height: 66px;
    object-fit: contain;
}

.brand-mark-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-subtitle {
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    padding: 3px 9px;
    color: rgba(255, 255, 255, .8);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 800;
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    font-size: .95rem;
    color: #394A45;
}

.nav-links a:hover {
    color: var(--forest);
}

.button,
.button-secondary,
.button-ghost,
.danger-button {
    min-height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
}

.button {
    background: var(--forest);
    color: white;
    box-shadow: 0 14px 28px rgba(36, 59, 54, .16);
}

.button:hover {
    background: #19312C;
}

.button-secondary {
    background: var(--paper);
    color: var(--forest);
    border-color: var(--line);
}

.button-ghost {
    background: transparent;
    color: var(--forest);
    border-color: var(--line);
}

.danger-button {
    background: #7D2E2E;
    color: white;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.section {
    padding: 72px 0;
}

.section.tight {
    padding: 42px 0;
}

.hero {
    min-height: 640px;
    display: grid;
    align-items: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(247, 242, 234, .96) 0%, rgba(247, 242, 234, .88) 36%, rgba(247, 242, 234, .18) 68%),
        url("/assets/images/hero-family.webp") center right / cover no-repeat;
}

.hero-content {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 82px 0 120px;
}

.hero h1 {
    max-width: 600px;
    margin: 0 0 20px;
    color: var(--forest);
    font-size: clamp(3rem, 7vw, 6.4rem);
    line-height: .95;
    font-weight: 500;
}

.hero p {
    max-width: 540px;
    margin: 0 0 28px;
    color: #51615C;
    font-size: 1.12rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.trust-strip {
    transform: translateY(-36px);
    margin-bottom: -10px;
}

.trust-inner {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: rgba(255, 253, 248, .94);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.trust-item {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-right: 1px solid var(--line);
    font-weight: 700;
    color: #3A4C47;
}

.trust-item:last-child {
    border-right: 0;
}

.icon-pill {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sage-soft);
    color: var(--forest);
    font-weight: 800;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.section-head h2,
.page-hero h1,
.app-title h1 {
    margin: 0;
    color: var(--forest);
    font-weight: 500;
}

.section-head h2,
.page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.02;
}

.section-head p,
.page-hero p {
    max-width: 620px;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.modules {
    grid-template-columns: repeat(3, 1fr);
}

.grid.three {
    grid-template-columns: repeat(3, 1fr);
}

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

.grid.four {
    grid-template-columns: repeat(4, 1fr);
}

.card,
.image-card,
.panel {
    background: rgba(255, 253, 248, .86);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.module-card {
    min-height: 100%;
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(178px, 1fr) auto;
}

.module-card-content {
    padding: 22px;
    display: grid;
    gap: 10px;
    align-content: start;
}

.module-card h3,
.image-card h3,
.panel h3 {
    margin: 0 0 8px;
    color: var(--forest);
    font-size: 1.35rem;
    font-weight: 500;
}

.module-card p,
.image-card p,
.panel p {
    color: var(--muted);
    margin: 0;
}

.module-card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-top: 1px solid var(--line);
}

.image-card {
    min-height: 190px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    isolation: isolate;
}

.image-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--image) center / cover no-repeat;
}

.image-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, rgba(24, 33, 31, .76), rgba(24, 33, 31, .05));
}

.image-card h3,
.image-card p {
    color: white;
}

.step-panel,
.cta-panel {
    padding: 30px;
}

.step-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.quote-band {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0;
    overflow: hidden;
}

.quote-band img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.quote-content {
    padding: 38px;
    display: grid;
    gap: 20px;
}

.cta-panel {
    background:
        linear-gradient(90deg, rgba(24, 33, 31, .94), rgba(36, 59, 54, .78)),
        url("/assets/images/soft-vase.webp") center / cover no-repeat;
    color: white;
}

.cta-panel h2,
.cta-panel p {
    color: white;
}

.page-hero {
    padding: 70px 0 34px;
}

.simple-list {
    display: grid;
    gap: 16px;
}

.simple-item {
    padding: 24px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-art {
    background:
        linear-gradient(0deg, rgba(24, 33, 31, .35), rgba(24, 33, 31, .08)),
        url("/assets/images/quiet-chair.webp") center / cover no-repeat;
}

.auth-card {
    width: min(520px, calc(100% - 32px));
    margin: auto;
    padding: 36px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    background: #F3EDE2;
}

.sidebar {
    background:
        linear-gradient(180deg, #203B36 0%, #162522 100%);
    color: rgba(255, 255, 255, .84);
    padding: 22px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar .brand {
    color: white;
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    padding: 10px 6px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.sidebar .brand-logo {
    max-width: 100%;
    max-height: 68px;
}

.sidebar .brand-name {
    max-width: 196px;
    font-size: .98rem;
    line-height: 1.08;
    white-space: nowrap;
    overflow-wrap: anywhere;
}

.sidebar .brand-mark {
    background: conic-gradient(from 40deg, var(--paper), var(--paper) 58%, var(--gold) 58%, var(--gold) 74%, var(--paper) 74%);
}

.sidebar .brand-mark::after {
    background: #203B36;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a,
.side-nav button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.side-nav a span,
.side-nav button span {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .1);
    font-size: .9rem;
}

.side-nav a.active,
.side-nav a:hover,
.side-nav button:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .12);
    color: white;
}

.app-main {
    padding: 34px;
    min-width: 0;
}

.app-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.app-title h1 {
    font-size: clamp(2rem, 4vw, 3.7rem);
    line-height: 1;
}

.app-title p {
    color: var(--muted);
    margin: 8px 0 0;
}

.stat-card {
    padding: 24px;
}

.score-ring {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--forest) calc(var(--score) * 1%), #E8E0D3 0);
    position: relative;
}

.score-ring::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--paper);
}

.score-ring strong {
    position: relative;
    z-index: 1;
    font-size: 1.8rem;
    color: var(--forest);
}

.score-ring.large {
    width: 156px;
    height: 156px;
}

.score-ring.large strong {
    font-size: 2.25rem;
}

.dashboard-hero {
    min-height: 390px;
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(36, 59, 54, .13);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: center;
    padding: 42px;
    margin-bottom: 28px;
    background:
        linear-gradient(90deg, rgba(255, 253, 248, .99) 0%, rgba(255, 253, 248, .91) 46%, rgba(255, 253, 248, .22) 78%),
        url("/assets/images/notebook-coffee.webp") center right / cover no-repeat;
}

.dashboard-hero-copy {
    max-width: 670px;
}

.dashboard-hero h1 {
    margin: 18px 0 14px;
    color: var(--forest);
    font-size: clamp(2.6rem, 5vw, 5rem);
    line-height: .98;
    font-weight: 500;
}

.dashboard-hero p {
    max-width: 560px;
    color: var(--muted);
    font-size: 1.08rem;
}

.dashboard-score {
    padding: 26px;
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
    background: rgba(255, 253, 248, .96);
    border-color: rgba(185, 150, 90, .32);
}

.dashboard-score p {
    font-size: .94rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

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

.dashboard-side,
.module-mosaic {
    display: grid;
    gap: 16px;
}

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

.module-tile {
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 253, 248, .96);
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    align-content: space-between;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.module-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(185, 150, 90, .45);
    box-shadow: 0 22px 48px rgba(36, 59, 54, .12);
}

.module-tile .icon-pill {
    background: #EFE3CF;
}

.module-tile h3 {
    margin: 0 0 8px;
    color: var(--forest);
    font-size: 1.32rem;
    font-weight: 500;
}

.module-tile p {
    margin: 0;
    color: var(--muted);
}

.help-panel {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(0deg, rgba(24, 33, 31, .86), rgba(24, 33, 31, .28)),
        url("/assets/images/soft-vase.webp") center / cover no-repeat;
}

.help-panel h3,
.help-panel p {
    color: white;
}

.dashboard-summary {
    margin-top: 22px;
}

.progress-line {
    height: 8px;
    width: 100%;
    border-radius: 99px;
    background: #E8E0D3;
    overflow: hidden;
}

.progress-line span {
    display: block;
    height: 100%;
    width: var(--progress);
    background: var(--forest);
    border-radius: inherit;
}

.rich-content {
    color: var(--muted);
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote {
    margin: 0 0 12px;
}

.rich-content p:last-child,
.rich-content ul:last-child,
.rich-content ol:last-child,
.rich-content blockquote:last-child {
    margin-bottom: 0;
}

.rich-content h2,
.rich-content h3 {
    margin: 14px 0 8px;
    color: var(--forest);
}

.rich-content a {
    color: var(--forest);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content {
    font-size: 1.12rem;
}

.section-card-image {
    width: calc(100% + 48px);
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    margin: -24px -24px 18px;
    border-bottom: 1px solid var(--line);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field.full,
.full {
    grid-column: 1 / -1;
}

label,
.field span {
    color: #40504B;
    font-weight: 700;
    font-size: .93rem;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(36, 59, 54, .18);
    border-radius: 12px;
    background: rgba(255, 253, 248, .86);
    color: var(--ink);
    padding: 11px 13px;
}

textarea {
    min-height: 122px;
    resize: vertical;
}

.cms-editor-section {
    margin-top: 28px;
}

.cms-block-list {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.cms-block-editor {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(247, 242, 234, .45);
    padding: 18px;
}

.cms-block-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.editor-toolbar button {
    min-width: 38px;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--forest);
    font-weight: 800;
    cursor: pointer;
}

.wysiwyg-editor {
    min-height: 150px;
    display: block;
    width: 100%;
    border: 1px solid rgba(36, 59, 54, .18);
    border-radius: 12px;
    background: rgba(255, 253, 248, .94);
    color: var(--ink);
    padding: 13px;
    outline: none;
}

.wysiwyg-editor:focus {
    border-color: rgba(185, 150, 90, .8);
    box-shadow: 0 0 0 3px rgba(185, 150, 90, .16);
}

.article-editor {
    min-height: 320px;
}

.cms-image-preview {
    width: 220px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.branding-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.branding-card {
    padding: 20px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.branding-preview {
    min-height: 136px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #F3EDE2;
    display: grid;
    place-items: center;
    padding: 18px;
}

.branding-preview img {
    max-width: 100%;
    max-height: 98px;
    object-fit: contain;
}

.branding-copy {
    min-width: 0;
    display: grid;
    gap: 10px;
}

input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--forest);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    background: var(--paper);
}

.alert.success {
    background: #EEF5EC;
    color: #28442E;
}

.alert.error {
    background: #F8EAEA;
    color: #7D2E2E;
}

.table-list {
    display: grid;
    gap: 12px;
}

.row-card {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.row-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--sage-soft);
    color: var(--forest);
    font-weight: 700;
    font-size: .84rem;
}

.muted {
    color: var(--muted);
}

.fineprint {
    color: var(--muted);
    font-size: .92rem;
}

.split-hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    align-items: stretch;
}

.split-hero img {
    border-radius: 18px;
    object-fit: cover;
    height: 100%;
}

footer {
    border-top: 1px solid var(--line);
    padding: 28px 0;
    color: var(--muted);
}

@media (max-width: 1080px) {
    .nav-links {
        display: none;
    }

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

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

    .dashboard-hero,
    .dashboard-grid,
    .branding-grid,
    .branding-card {
        grid-template-columns: 1fr;
    }

    .dashboard-score {
        justify-items: start;
        text-align: left;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .side-nav {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .nav-inner {
        min-height: auto;
        padding: 14px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-actions {
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        min-height: 620px;
        background:
            linear-gradient(0deg, rgba(247, 242, 234, .98) 0%, rgba(247, 242, 234, .82) 48%, rgba(247, 242, 234, .2) 100%),
            url("/assets/images/hero-family.webp") center / cover no-repeat;
    }

    .hero-content {
        align-self: end;
        padding-top: 230px;
    }

    .trust-inner,
    .grid.modules,
    .grid.three,
    .grid.two,
    .grid.four,
    .step-list,
    .quote-band,
    .auth-shell,
    .split-hero,
    .form-grid,
    .module-mosaic {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        padding: 24px;
        background:
            linear-gradient(0deg, rgba(255, 253, 248, .98) 0%, rgba(255, 253, 248, .88) 55%, rgba(255, 253, 248, .3) 100%),
            url("/assets/images/notebook-coffee.webp") center / cover no-repeat;
    }

    .trust-item {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-nav {
        grid-template-columns: 1fr 1fr;
    }

    .app-main,
    .sidebar {
        padding: 20px;
    }

    .app-top,
    .section-head,
    .row-header {
        align-items: stretch;
        flex-direction: column;
    }
}
