/*
 * public-trust.css  v9
 * Public legal, trust, and contact pages.
 * Loaded alongside marketing.css for public shell.
 * Loaded alongside app.css for signed-in shell.
 *
 * v9 — Session 156: dual-shell support.
 *   Added .trust-inapp — clean in-app document layout using --color-* tokens.
 *   Public shell unchanged from v8.
 */

/* ── Page shell ────────────────────────────────────────────────────────── */

.trust-page {
    background: var(--m-bg-subtle);
    color: var(--m-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.trust-page > main {
    flex: 1 0 auto;
}

.trust-hero .m-wrap,
.trust-shell .m-wrap {
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: var(--m-gutter);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.trust-hero {
    background: var(--m-bg);
    border-bottom: 1px solid var(--m-border);
    position: relative;
    overflow: hidden;
}

/* Brand radial glow — same pattern as marketing hero */
.trust-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 80% at 0% 50%, oklch(52% 0.22 265 / 0.055) 0%, transparent 65%),
        radial-gradient(ellipse 50% 60% at 100% 0%, oklch(52% 0.22 265 / 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.trust-hero__inner {
    position: relative;
    padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.25rem, 4.5vw, 3.5rem);
    max-width: 52rem;
}

/* Eyebrow kicker */
.trust-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 1rem;
    color: var(--m-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* Decorative dot before kicker */
.trust-kicker::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--m-brand);
    opacity: 0.7;
    flex-shrink: 0;
}

.trust-hero h1 {
    margin: 0;
    color: var(--m-text);
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.03em;
}

.trust-hero__inner > p:not(.trust-kicker) {
    margin: 1.125rem 0 0;
    max-width: 52ch;
    color: var(--m-text-2);
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.68;
}

/* Date + quick-link pills */
.trust-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.625rem;
    margin-top: 1.75rem;
}

.trust-meta span,
.trust-meta a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    padding: 0.25rem 0.875rem;
    border: 1px solid var(--m-border);
    border-radius: 999px;
    background: var(--m-bg-subtle);
    color: var(--m-text-3);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 160ms, background 160ms, color 160ms;
    white-space: nowrap;
}

.trust-meta a {
    color: var(--m-brand);
    border-color: var(--m-brand-dim);
    background: var(--m-brand-dim2);
}

.trust-meta a:hover,
.trust-meta a:focus-visible {
    border-color: oklch(52% 0.22 265 / 0.3);
    background: oklch(52% 0.22 265 / 0.1);
    color: var(--m-brand-hover);
    outline: none;
}

/* ── Content shell ─────────────────────────────────────────────────────── */

.trust-shell {
    padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(5rem, 9vw, 8rem);
}

.trust-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4.5rem);
    align-items: start;
}

/* ── Rail ──────────────────────────────────────────────────────────────── */

.trust-rail {
    position: sticky;
    top: clamp(1.5rem, 4vw, 2.5rem);
    display: grid;
    gap: 0.875rem;
}

.trust-rail__group {
    padding: 1.25rem 1.25rem 1.125rem;
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    background: var(--m-bg);
    box-shadow: var(--m-shadow-sm);
}

/* Rail group heading — small uppercase label with brand dot */
.trust-rail h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.875rem;
    color: var(--m-text-3);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.trust-rail h2::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--m-brand);
    opacity: 0.55;
    flex-shrink: 0;
}

/* Checkmark bullets in rail summary */
.trust-rail ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.trust-rail li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--m-text-2);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* SVG checkmark via inline background */
.trust-rail li::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 0.125rem;
    border-radius: 50%;
    background-color: var(--m-brand-dim2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='oklch(52%25 0.22 265)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px;
}

/* Related links */
.trust-links {
    display: grid;
}

.trust-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-top: 1px solid var(--m-border);
    color: var(--m-brand);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 140ms, padding-left 140ms;
}

.trust-links a::after {
    content: '→';
    font-size: 0.875rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 140ms, transform 140ms;
}

.trust-links a:first-of-type {
    border-top: none;
    padding-top: 0;
}

.trust-links a:hover,
.trust-links a:focus-visible {
    color: var(--m-brand-hover);
    padding-left: 0.2rem;
    outline: none;
}

.trust-links a:hover::after,
.trust-links a:focus-visible::after {
    opacity: 0.6;
    transform: translateX(0);
}

/* ── Article ───────────────────────────────────────────────────────────── */

.trust-copy {
    min-width: 0;
    counter-reset: trust-section;
}

.trust-copy section {
    padding-block: clamp(1.75rem, 2.8vw, 2.5rem);
    position: relative;
}

.trust-copy section + section {
    border-top: 1px solid var(--m-border);
}

/* Section h2 — numbered via CSS counter, with left accent on hover */
.trust-copy h2 {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 0 0 1rem;
    color: var(--m-text);
    font-size: clamp(1.0625rem, 1.8vw, 1.3125rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

/* Counter number — only on numbered sections (h2 that start with a digit) */
/* We use a counter for all h2 but hide it on cookies page unnumbered sections */
.trust-copy--numbered {
    counter-reset: trust-section;
}

.trust-copy--numbered section h2::before {
    counter-increment: trust-section;
    content: counter(trust-section);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--m-brand-dim2);
    border: 1px solid var(--m-brand-dim);
    color: var(--m-brand);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
    margin-top: 0.1rem;
    align-self: flex-start;
}

/* Left accent bar on section hover */
.trust-copy section::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: clamp(1.75rem, 2.8vw, 2.5rem);
    bottom: clamp(1.75rem, 2.8vw, 2.5rem);
    width: 2px;
    border-radius: 2px;
    background: var(--m-brand);
    opacity: 0;
    transition: opacity 200ms;
}

.trust-copy section:hover::before {
    opacity: 0.35;
}

/* Body text */
.trust-copy p,
.trust-copy li {
    color: var(--m-text-2);
    font-size: 1rem;
    line-height: 1.8;
}

.trust-copy p {
    margin: 0;
}

.trust-copy p + p,
.trust-copy p + ul,
.trust-copy ul + p {
    margin-top: 0.875rem;
}

.trust-copy ul {
    margin: 0;
    padding-left: 1.125rem;
}

.trust-copy li + li {
    margin-top: 0.5rem;
}

/* Inline links */
.trust-copy a {
    color: var(--m-brand);
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    padding-inline: 0.125rem;
    transition: background 140ms, color 140ms;
}

.trust-copy a:hover,
.trust-copy a:focus-visible {
    background: var(--m-brand-dim2);
    color: var(--m-brand-hover);
    outline: none;
}

/* ── Contact layout ────────────────────────────────────────────────────── */

.trust-contact {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(15rem, 0.7fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}

.trust-copy--contact {
    background: var(--m-bg);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    box-shadow: var(--m-shadow-sm);
}

.trust-contact__aside {
    display: grid;
    gap: 0.875rem;
}

.trust-contact__aside section {
    background: var(--m-bg);
    border: 1px solid var(--m-border);
    border-radius: var(--m-radius);
    padding: 1.25rem 1.25rem 1.375rem;
    box-shadow: var(--m-shadow-sm);
}

.trust-contact__aside h2 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.625rem;
    color: var(--m-text);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.trust-contact__aside p {
    margin: 0;
    color: var(--m-text-2);
    font-size: 0.9rem;
    line-height: 1.65;
}

.trust-contact__aside p + p {
    margin-top: 0.5rem;
}

.trust-contact__aside a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.875rem;
    color: var(--m-brand);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 3px;
    padding-inline: 0.125rem;
    transition: background 140ms, color 140ms;
}

.trust-contact__aside a::after {
    content: '→';
    font-size: 0.85rem;
    transition: transform 140ms;
}

.trust-contact__aside a:hover,
.trust-contact__aside a:focus-visible {
    background: var(--m-brand-dim2);
    color: var(--m-brand-hover);
    outline: none;
}

.trust-contact__aside a:hover::after {
    transform: translateX(3px);
}

/* ── Contact form ──────────────────────────────────────────────────────── */

.trust-form {
    display: grid;
    gap: 1.25rem;
}

.trust-form__trap {
    position: absolute;
    inset-inline-start: -10000px;
    block-size: 1px;
    inline-size: 1px;
    overflow: hidden;
}

.trust-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem;
}

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

.trust-field label {
    color: var(--m-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.trust-field input,
.trust-field select,
.trust-field textarea {
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid var(--m-border-strong);
    border-radius: var(--m-radius-sm);
    background: var(--m-bg-subtle);
    color: var(--m-text);
    font: inherit;
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    transition: border-color 140ms, box-shadow 140ms, background 140ms;
    appearance: none;
    -webkit-appearance: none;
}

.trust-field input:hover,
.trust-field select:hover,
.trust-field textarea:hover {
    background: var(--m-bg);
    border-color: var(--m-border-strong);
}

.trust-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
}

.trust-field textarea {
    min-height: 11rem;
    resize: vertical;
    line-height: 1.6;
}

.trust-field input::placeholder,
.trust-field textarea::placeholder {
    color: var(--m-text-3);
}

.trust-field input:focus,
.trust-field select:focus,
.trust-field textarea:focus {
    background: var(--m-bg);
    border-color: var(--m-brand);
    box-shadow: 0 0 0 3px var(--m-brand-dim);
    outline: none;
}

.trust-field [aria-invalid="true"] {
    border-color: oklch(50% 0.22 25);
    box-shadow: 0 0 0 3px oklch(50% 0.22 25 / 0.12);
}

.trust-field p {
    margin: 0;
    color: oklch(45% 0.2 25);
    font-size: 0.875rem;
    line-height: 1.45;
}

.trust-field .trust-field__hint {
    color: var(--m-text-2);
}

.trust-form__alert {
    border: 1px solid oklch(50% 0.22 25 / 0.22);
    border-radius: var(--m-radius-sm);
    background: oklch(97% 0.04 25);
    color: oklch(40% 0.2 25);
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.trust-success {
    border: 1px solid oklch(50% 0.18 145 / 0.25);
    border-radius: var(--m-radius-sm);
    background: oklch(97% 0.04 145);
    color: oklch(35% 0.16 145);
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.trust-form__button {
    justify-self: start;
}

.trust-form__turnstile {
    min-height: 65px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .trust-grid {
        grid-template-columns: 1fr;
    }

    .trust-rail {
        position: static;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }

    .trust-copy section::before {
        display: none;
    }

    .trust-contact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .trust-rail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .trust-hero__inner {
        padding-top: 2.25rem;
    }

    .trust-form__grid {
        grid-template-columns: 1fr;
    }

    .trust-meta {
        gap: 0.375rem;
    }

    .trust-copy--numbered section h2::before {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.6875rem;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   IN-APP SHELL — signed-in trust pages inside layouts/app.php
   Uses --color-* app tokens. Mirrors public visual design as closely
   as possible within the app shell constraints.
   ════════════════════════════════════════════════════════════════════════ */

/* Outer wrapper — no side padding, fills app-content__inner */
.trust-inapp {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

/* ── Hero header ────────────────────────────────────────────────────────── */

.trust-inapp__header {
    position: relative;
    overflow: hidden;
    padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

/* Brand radial glow — same as public hero, adapted for app shell */
.trust-inapp__header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 100% at 0% 50%, oklch(52% 0.22 265 / 0.06) 0%, transparent 65%),
        radial-gradient(ellipse 40% 70% at 100% 0%, oklch(52% 0.22 265 / 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.trust-inapp__header-inner {
    position: relative;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 4vw, 3rem);
}

.trust-inapp__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 1rem;
    color: oklch(52% 0.22 265);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.trust-inapp__kicker::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: oklch(52% 0.22 265);
    opacity: 0.7;
    flex-shrink: 0;
}

.trust-inapp__title {
    margin: 0 0 0.875rem;
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.028em;
}

.trust-inapp__sub {
    margin: 0 0 1.5rem;
    color: var(--text-2);
    font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
    line-height: 1.65;
    max-width: 52ch;
}

.trust-inapp__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.625rem;
}

.trust-inapp__meta span,
.trust-inapp__meta a {
    display: inline-flex;
    align-items: center;
    min-height: 1.875rem;
    padding: 0.25rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 140ms, background 140ms, color 140ms;
    white-space: nowrap;
    background: var(--bg);
}

.trust-inapp__meta a {
    color: oklch(52% 0.22 265);
    border-color: oklch(52% 0.22 265 / 0.25);
    background: oklch(52% 0.22 265 / 0.07);
}

.trust-inapp__meta a:hover,
.trust-inapp__meta a:focus-visible {
    background: oklch(52% 0.22 265 / 0.12);
    border-color: oklch(52% 0.22 265 / 0.4);
    outline: none;
}

/* ── Body: rail + article ────────────────────────────────────────────── */

.trust-inapp__body {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
    max-width: 1120px;
    margin-inline: auto;
    width: 100%;
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem);
    flex: 1;
}

/* Rail — identical look to public, using app token overrides */
.trust-inapp .trust-rail {
    position: sticky;
    top: 2rem;
}

.trust-inapp .trust-rail__group {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
}

.trust-inapp .trust-rail h2 {
    color: var(--text-3);
}

.trust-inapp .trust-rail h2::before {
    background: oklch(52% 0.22 265);
}

.trust-inapp .trust-rail li {
    color: var(--text-2);
}

.trust-inapp .trust-rail li::before {
    background-color: oklch(52% 0.22 265 / 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 24 24' fill='none' stroke='oklch(52%25 0.22 265)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px;
}

.trust-inapp .trust-links a {
    color: oklch(52% 0.22 265);
    border-top-color: var(--border);
}

.trust-inapp .trust-links a:hover,
.trust-inapp .trust-links a:focus-visible {
    color: oklch(46% 0.22 265);
}

/* Article — app token colours, same structure/spacing as public */
.trust-inapp .trust-copy section {
    padding-block: clamp(1.75rem, 2.8vw, 2.5rem);
}

.trust-inapp .trust-copy section + section {
    border-top-color: var(--border);
}

.trust-inapp .trust-copy h2 {
    color: var(--text);
    font-size: clamp(1.0625rem, 1.8vw, 1.3125rem);
}

.trust-inapp .trust-copy--numbered section h2::before {
    background: oklch(52% 0.22 265 / 0.1);
    border-color: oklch(52% 0.22 265 / 0.25);
    color: oklch(52% 0.22 265);
}

.trust-inapp .trust-copy section::before {
    background: oklch(52% 0.22 265);
}

.trust-inapp .trust-copy p,
.trust-inapp .trust-copy li {
    color: var(--text-2);
}

.trust-inapp .trust-copy a {
    color: oklch(52% 0.22 265);
}

.trust-inapp .trust-copy a:hover,
.trust-inapp .trust-copy a:focus-visible {
    background: oklch(52% 0.22 265 / 0.08);
    color: oklch(46% 0.22 265);
}

/* In-app responsive */
@media (max-width: 900px) {
    .trust-inapp__body {
        grid-template-columns: 1fr;
    }

    .trust-inapp .trust-rail {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .trust-inapp .trust-copy section::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .trust-inapp .trust-rail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .trust-inapp__header {
        padding-inline: 1rem;
        padding-top: 2rem;
    }

    .trust-inapp__body {
        padding-inline: 1rem;
    }

    .trust-inapp__meta {
        gap: 0.375rem;
    }

    .trust-inapp .trust-copy--numbered section h2::before {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.6875rem;
    }
}
