/*
|--------------------------------------------------------------------------
| ClearMind Legal & Support
|--------------------------------------------------------------------------
*/

:root {
    --cm-primary: #11845f;
    --cm-primary-dark: #075f43;
    --cm-primary-soft: #e9f8f1;
    --cm-lime: #c9ef72;
    --cm-ink: #14251f;
    --cm-text: #40534b;
    --cm-muted: #7a8983;
    --cm-border: #dfe9e4;
    --cm-page: #f5f7f3;
    --cm-surface: #ffffff;
    --cm-danger: #b64b4b;
    --cm-shadow: 0 22px 55px rgba(33, 76, 61, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.cm-legal-body {
    margin: 0;
    background: var(--cm-page);
    color: var(--cm-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

.cm-legal-page {
    min-height: 100vh;
    overflow: hidden;
}

.cm-legal-header {
    width: min(100% - 42px, 1500px);
    min-height: 82px;
    margin: 20px auto 0;
    padding: 0 22px;
    border: 1px solid var(--cm-border);
    border-radius: 23px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 34px rgba(39, 78, 64, 0.06);
    backdrop-filter: blur(12px);
}

.cm-legal-logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.cm-legal-logo-mark {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--cm-primary-dark), var(--cm-primary));
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 12px 27px rgba(17, 132, 95, 0.17);
}

.cm-legal-logo-copy {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.cm-legal-logo-copy strong {
    color: var(--cm-ink);
    font-size: 19px;
    letter-spacing: -0.035em;
}

.cm-legal-logo-copy small {
    margin-top: 5px;
    color: var(--cm-primary);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.22em;
}

.cm-legal-nav {
    justify-self: center;
    padding: 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f3f6f2;
}

.cm-legal-nav a {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: var(--cm-text);
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}

.cm-legal-nav a:hover,
.cm-legal-nav a.is-active {
    background: #fff;
    color: var(--cm-primary-dark);
    box-shadow: 0 6px 16px rgba(33, 76, 61, 0.05);
}

.cm-legal-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.cm-legal-button {
    min-height: 43px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 850;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

.cm-legal-button-primary {
    background: linear-gradient(135deg, var(--cm-primary-dark), var(--cm-primary));
    color: #fff;
    box-shadow: 0 12px 24px rgba(17, 132, 95, 0.17);
}

.cm-legal-button-ghost {
    border: 1px solid var(--cm-border);
    background: #fff;
    color: var(--cm-primary-dark);
}

.cm-legal-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--cm-border);
    border-radius: 13px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    background: #fff;
    cursor: pointer;
}

.cm-legal-menu-button span {
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: var(--cm-ink);
}

.cm-legal-mobile-menu {
    display: none;
}

.cm-legal-hero {
    width: min(100% - 42px, 1450px);
    margin: 20px auto 0;
    padding: 72px 32px;
    border-radius: 30px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 8%, rgba(201, 239, 114, 0.18), transparent 30%),
        linear-gradient(145deg, #f8f6ef, #f0f3ea);
}

.cm-legal-eyebrow {
    color: var(--cm-primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.cm-legal-hero h1 {
    margin: 10px auto 13px;
    color: var(--cm-ink);
    font-size: clamp(42px, 5.2vw, 72px);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.cm-legal-hero p {
    max-width: 820px;
    margin: 0 auto;
    color: var(--cm-muted);
    font-size: 13px;
    line-height: 1.75;
}

.cm-legal-updated {
    width: fit-content;
    margin: 20px auto 0;
    padding: 8px 11px;
    border: 1px solid rgba(17, 132, 95, 0.13);
    border-radius: 999px;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.78);
    color: var(--cm-primary-dark);
    font-size: 8px;
    font-weight: 800;
}

.cm-legal-content-shell {
    width: min(100% - 42px, 1320px);
    margin: 24px auto 100px;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.cm-legal-toc-card {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    padding: 21px;
    border: 1px solid var(--cm-border);
    border-radius: 21px;
    overflow: auto;
    background: #fff;
    box-shadow: 0 14px 34px rgba(33, 76, 61, 0.05);
}

.cm-legal-toc-card > span {
    display: block;
    margin-bottom: 12px;
    color: var(--cm-ink);
    font-size: 10px;
    font-weight: 850;
}

.cm-legal-toc {
    display: grid;
    gap: 3px;
}

.cm-legal-toc a {
    padding: 8px 9px;
    border-radius: 10px;
    color: var(--cm-muted);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.cm-legal-toc a:hover,
.cm-legal-toc a.is-active {
    background: var(--cm-primary-soft);
    color: var(--cm-primary-dark);
}

.cm-legal-toc a.cm-legal-toc-sub {
    padding-left: 18px;
    font-size: 7px;
    opacity: 0.92;
}

.cm-legal-article {
    padding: 38px 42px;
    border: 1px solid var(--cm-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--cm-shadow);
}

.cm-legal-article > p:first-child {
    margin-top: 0;
    color: var(--cm-ink);
    font-size: 14px;
}

.cm-legal-article h2,
.cm-legal-article h3 {
    scroll-margin-top: 24px;
    color: var(--cm-ink);
    letter-spacing: -0.025em;
}

.cm-legal-article h2 {
    margin: 38px 0 12px;
    padding-top: 5px;
    font-size: 22px;
}

.cm-legal-article h2:first-of-type {
    margin-top: 26px;
}

.cm-legal-article h3 {
    margin: 25px 0 9px;
    color: var(--cm-primary-dark);
    font-size: 15px;
}

.cm-legal-article p {
    margin: 0 0 14px;
    color: var(--cm-text);
    font-size: 11px;
    line-height: 1.85;
}

.cm-legal-article ul,
.cm-legal-article ol {
    margin: 5px 0 20px;
    padding-left: 23px;
}

.cm-legal-article li {
    margin: 7px 0;
    color: var(--cm-text);
    font-size: 10px;
    line-height: 1.72;
}

.cm-legal-article a {
    color: var(--cm-primary-dark);
    font-weight: 800;
}

.cm-legal-article strong {
    color: var(--cm-ink);
}

.cm-support-shell {
    width: min(100% - 42px, 1180px);
    margin: 24px auto 28px;
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
    gap: 22px;
    align-items: stretch;
}

.cm-support-info,
.cm-support-form-card {
    border: 1px solid var(--cm-border);
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--cm-shadow);
}

.cm-support-info {
    padding: 34px;
}

.cm-support-info h2,
.cm-support-form-head h2 {
    margin: 8px 0 9px;
    color: var(--cm-ink);
    font-size: 29px;
    letter-spacing: -0.035em;
}

.cm-support-info > p,
.cm-support-form-head p {
    margin: 0;
    color: var(--cm-muted);
    font-size: 10px;
    line-height: 1.7;
}

.cm-support-info-list {
    margin-top: 28px;
    display: grid;
    gap: 13px;
}

.cm-support-info-list article {
    padding: 14px;
    border: 1px solid #edf2ef;
    border-radius: 15px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: #fbfdfc;
}

.cm-support-info-list article > span {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--cm-primary-soft);
    color: var(--cm-primary-dark);
    font-size: 8px;
    font-weight: 850;
}

.cm-support-info-list strong {
    color: var(--cm-ink);
    font-size: 10px;
}

.cm-support-info-list p {
    margin: 4px 0 0;
    color: var(--cm-muted);
    font-size: 8px;
    line-height: 1.55;
}

.cm-support-direct {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cm-border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cm-support-direct small {
    color: var(--cm-muted);
    font-size: 8px;
}

.cm-support-direct a {
    color: var(--cm-primary-dark);
    font-size: 11px;
    font-weight: 850;
    text-decoration: none;
}

.cm-support-inbox-button {
    margin-top: 17px;
}

.cm-support-form-card {
    padding: 34px;
}

.cm-support-form-head {
    margin-bottom: 23px;
}

.cm-support-form-head > span {
    color: var(--cm-primary);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.cm-support-form {
    display: grid;
    gap: 16px;
}

.cm-support-field label {
    margin-bottom: 7px;
    display: block;
    color: var(--cm-ink);
    font-size: 10px;
    font-weight: 800;
}

.cm-support-field input,
.cm-support-field textarea {
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--cm-border);
    border-radius: 14px;
    outline: none;
    background: #fff;
    color: var(--cm-text);
    font-size: 11px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.cm-support-field input {
    min-height: 50px;
}

.cm-support-field textarea {
    min-height: 175px;
    padding-top: 13px;
    resize: vertical;
    line-height: 1.65;
}

.cm-support-field input:focus,
.cm-support-field textarea:focus {
    border-color: var(--cm-primary);
    box-shadow: 0 0 0 4px rgba(17, 132, 95, 0.09);
}

.cm-support-field small {
    margin-top: 6px;
    display: block;
    color: var(--cm-danger);
    font-size: 8px;
    font-weight: 750;
}

.cm-support-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 2px;
    justify-content: space-between;
    border: 0;
}

.cm-support-submit span {
    font-size: 17px;
}

.cm-legal-alert {
    margin-bottom: 18px;
    padding: 12px 13px;
    border: 1px solid;
    border-radius: 13px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 9px;
    line-height: 1.5;
}

.cm-legal-alert > span {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 900;
}

.cm-legal-alert p {
    margin: 2px 0 0;
}

.cm-legal-alert.is-success {
    border-color: #cdeedf;
    background: #f2fff8;
    color: #176748;
}

.cm-legal-alert.is-error {
    border-color: #f0d0d0;
    background: #fff7f7;
    color: var(--cm-danger);
}

.cm-support-faq {
    width: min(100% - 42px, 1180px);
    margin: 0 auto 100px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.cm-support-faq article {
    padding: 20px;
    border: 1px solid var(--cm-border);
    border-radius: 18px;
    background: #fff;
}

.cm-support-faq strong {
    color: var(--cm-ink);
    font-size: 10px;
}

.cm-support-faq p {
    margin: 6px 0 0;
    color: var(--cm-muted);
    font-size: 8px;
    line-height: 1.55;
}

.cm-legal-footer {
    padding: 56px max(24px, calc((100% - 1320px) / 2));
    background: #11251e;
    color: #fff;
}

.cm-legal-footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 50px;
}

.cm-legal-footer-main > div {
    max-width: 430px;
}

.cm-legal-footer-logo .cm-legal-logo-copy strong {
    color: #fff;
}

.cm-legal-footer-main p {
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 9px;
    line-height: 1.7;
}

.cm-legal-footer-main nav {
    display: grid;
    gap: 11px;
}

.cm-legal-footer-main nav a {
    color: rgba(255, 255, 255, 0.62);
    font-size: 9px;
    text-decoration: none;
}

.cm-legal-footer-main nav a:hover {
    color: var(--cm-lime);
}

.cm-legal-footer-bottom {
    margin-top: 42px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: rgba(255, 255, 255, 0.42);
    font-size: 8px;
}

@media (max-width: 980px) {
    .cm-legal-nav,
    .cm-legal-actions {
        display: none;
    }

    .cm-legal-header {
        grid-template-columns: auto 1fr auto;
    }

    .cm-legal-menu-button {
        display: flex;
        justify-self: end;
    }

    .cm-legal-mobile-menu {
        position: relative;
        z-index: 20;
        width: min(100% - 42px, 1500px);
        margin: 8px auto 0;
        padding: 12px;
        border: 1px solid var(--cm-border);
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 14px 30px rgba(32, 75, 59, 0.08);
    }

    .cm-legal-mobile-menu.is-open {
        display: grid;
        gap: 6px;
    }

    .cm-legal-mobile-menu a {
        min-height: 42px;
        padding: 0 12px;
        border-radius: 11px;
        display: flex;
        align-items: center;
        color: var(--cm-text);
        font-size: 10px;
        font-weight: 800;
        text-decoration: none;
    }

    .cm-legal-mobile-menu a.is-primary {
        background: var(--cm-primary);
        color: #fff;
    }

    .cm-legal-content-shell {
        grid-template-columns: 1fr;
    }

    .cm-legal-toc-card {
        position: static;
        max-height: none;
    }

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

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

@media (max-width: 680px) {
    .cm-legal-header,
    .cm-legal-mobile-menu,
    .cm-legal-hero,
    .cm-legal-content-shell,
    .cm-support-shell,
    .cm-support-faq {
        width: min(100% - 24px, 1320px);
    }

    .cm-legal-header {
        min-height: 72px;
        margin-top: 12px;
        padding: 0 14px;
    }

    .cm-legal-logo-copy {
        display: none;
    }

    .cm-legal-hero {
        padding: 50px 20px;
        border-radius: 23px;
    }

    .cm-legal-hero h1 {
        font-size: 42px;
    }

    .cm-legal-content-shell {
        margin-bottom: 70px;
    }

    .cm-legal-toc {
        grid-template-columns: 1fr;
    }

    .cm-legal-article {
        padding: 26px 20px;
        border-radius: 20px;
    }

    .cm-legal-article h2 {
        font-size: 19px;
    }

    .cm-support-info,
    .cm-support-form-card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .cm-support-faq {
        grid-template-columns: 1fr;
        margin-bottom: 70px;
    }

    .cm-legal-footer {
        padding: 46px 22px;
    }

    .cm-legal-footer-main,
    .cm-legal-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}
