/* ==================================================================
   Yorix — consent & demo forms
   Inherits :root tokens from style.css. Load style.css first.
   ================================================================== */

.consent-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px var(--pad) 90px;
}

/* ---------- Page head ---------- */
.consent-head { max-width: 920px; margin-bottom: 46px; }
.consent-h1 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
}
.consent-lede { font-size: clamp(1.02rem, 1.4vw, 1.16rem); color: var(--ink-body); }

/* ---------- Steps ---------- */
.steps {
    display: flex; flex-wrap: wrap; gap: 10px;
    list-style: none; margin: 0 0 36px;
    padding: 0 0 26px; border-bottom: 1px solid var(--line);
}
.step {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 15px 7px 8px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--paper-2);
    font-size: 0.88rem; color: var(--ink-soft);
    transition: border-color .2s ease, color .2s ease;
}
.step-no {
    display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--line); color: var(--ink-soft);
    font-size: 0.75rem; font-weight: 600; flex: 0 0 auto;
}
.step.is-current { border-color: var(--accent); color: var(--ink); }
.step.is-current .step-no { background: var(--accent); color: #fff; }
.step.is-done { color: var(--ink); }
.step.is-done .step-no { background: var(--accent-ink); color: #fff; }

/* ---------- Panels ---------- */
.cpanel { animation: cfade .25s ease; }
@keyframes cfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cpanel-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 42px; }
.cpanel-no {
    flex: 0 0 auto;
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    font-family: "Fraunces", serif; font-weight: 600; font-size: 1.05rem;
}
.cpanel-no--done { background: var(--accent); color: #fff; border-color: var(--accent); }
.cpanel-title {
    font-family: "Fraunces", Georgia, serif; font-weight: 500;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.15;
    letter-spacing: -0.01em; margin-bottom: 7px;
}
.cpanel-sub { color: var(--ink-body); font-size: 1rem; }
.cpanel-actions {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line);
}

/* ---------- Fields ---------- */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; }
.field { display: flex; flex-direction: column; }
.field label {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 8px;
    display: flex; align-items: center; gap: 9px;
}
.req-tag, .opt-tag {
    font-size: 0.66rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 5px; white-space: nowrap;
}
.req-tag { background: var(--accent); color: #fff; }
.opt-tag { background: var(--line); color: var(--ink-soft); }

.field input, .field select {
    font-family: inherit; font-size: 1rem; color: var(--ink);
    padding: 13px 15px;
    border: 1.5px solid var(--line); border-radius: 9px;
    background: var(--paper-2);
    transition: border-color .18s ease, box-shadow .18s ease;
    width: 100%;
}
.field input:focus, .field select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22,112,107,0.12);
}
.field input.is-bad { border-color: var(--alert); }
.field-hint { font-size: 0.85rem; color: var(--ink-body); margin-top: 7px; line-height: 1.5; }
.field-err { font-size: 0.85rem; color: var(--alert); margin-top: 7px; font-weight: 500; }

.input-combo { display: flex; align-items: stretch; }
.combo-prefix {
    display: grid; place-items: center;
    padding: 0 13px;
    border: 1.5px solid var(--line); border-right: none;
    border-radius: 9px 0 0 9px;
    background: var(--paper);
    color: var(--ink-soft); font-size: 0.95rem; font-weight: 500;
    flex: 0 0 auto;
}
.input-combo input { border-radius: 0 9px 9px 0; }

/* Full-width field — the enquiry textarea */
.field--wide { display: flex; flex-direction: column; margin-top: 26px; }
.field--wide label {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 8px;
    display: flex; align-items: center; gap: 9px;
}
.field--wide textarea {
    font-family: inherit; font-size: 1rem; color: var(--ink);
    padding: 14px 15px; line-height: 1.6; resize: vertical; min-height: 120px;
    border: 1.5px solid var(--line); border-radius: 9px;
    background: var(--paper-2);
    transition: border-color .18s ease, box-shadow .18s ease;
    width: 100%;
}
.field--wide textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22,112,107,0.12);
}
.field--wide textarea.is-bad { border-color: var(--alert); }

/* ---------- Callout blocks ---------- */
.minimise-note, .verify-why {
    margin-top: 34px; padding: 22px 24px;
    border-left: 3px solid var(--accent);
    background: var(--paper-2);
    border-radius: 0 11px 11px 0;
    color: var(--ink-body); font-size: 0.96rem; line-height: 1.65;
}
.minimise-note strong, .verify-why strong { color: var(--ink); }

/* ---------- Notice card ---------- */
.notice-card {
    padding: 30px;
    border: 1px solid var(--line); border-radius: 15px;
    background: var(--paper-2);
    margin-bottom: 40px;
}
.notice-card-top {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px; margin-bottom: 20px;
}
.notice-h {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 500;
    font-size: 1.45rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--ink);
    max-width: 34ch;
}

.notice-body {
    margin-top: 24px;
    margin-bottom: 24px;

    max-width: 76ch;

    font-size: 0.98rem;
    line-height: 1.9;

    color: var(--ink-body);

    text-align: justify;
    text-justify: inter-word;

    hyphens: auto;
}

.notice-body strong {
    color: var(--ink);
    font-weight: 600;
}


.lang-pick { display: flex; align-items: center; gap: 10px; }
.lang-pick label { font-size: 0.85rem; color: var(--ink-soft); }
.lang-pick select {
    font-family: inherit; font-size: 0.9rem; padding: 8px 12px;
    border: 1.5px solid var(--line); border-radius: 8px;
    background: var(--paper); color: var(--ink);
}

.notice-meta {
    list-style: none;

    margin: 32px 0 0;
    padding: 28px 0 0;

    border-top: 1px solid var(--line);

    display: grid;
    gap: 12px;
}

.notice-meta li {
    display: grid;

    grid-template-columns: 240px 1fr;

    gap: 24px;

    padding: 8px 0;

    font-size: 0.94rem;
}

.nm-k {
    color: var(--ink-soft);
    font-weight: 500;
}

.nm-v {
    color: var(--ink);
    font-weight: 500;
    line-height: 1.65;
}
.nm-v a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.table-intro { color: var(--ink-soft); max-width: 90ch; margin-bottom: 26px; line-height: 1.7; }

/* ==================================================================
   CONSENT TABLE — the four columns
   ================================================================== */
.ctable-wrap {
    border: 1px solid var(--emerald-line);
    overflow: hidden; background: var(--paper-2);
}
.ctable-head {
    display: grid;
    grid-template-columns: 1.05fr 2fr 0.65fr 0.85fr;

    gap: 20px;
    padding: 18px 26px;

    background: var(--emerald-strong);

    border-bottom: 1px solid var(--accent);

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: #ffffff;
}
.crow {
    display: grid;
    grid-template-columns: 1.05fr 2fr 0.65fr 0.85fr;
    gap: 24px; padding: 18px 26px; align-items: start;
    border-bottom: 1px solid var(--line);
    transition: background .18s ease;
}
.crow:last-child { border-bottom: none; }
.crow.is-needed { background: rgba(22,112,107,0.035); }
.crow.is-unset { background: rgba(154,91,35,0.06); }

.c-name { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 8px; line-height: 1.4; }
.c-badge {
    display: inline-block;
    font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 5px;
    background: var(--line); color: var(--ink-soft);
}
.c-badge--need { background: var(--accent); color: #fff; }
.c-why { color: var(--ink-body); font-size: 0.94rem; line-height: 1.6; }

.c-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 9px; line-height: 1.5; }
.c-note--dep { color: var(--alert); }

/* ---------- THE YES / NO TOGGLE ---------- */
.toggle {
    display: inline-flex;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
    background: var(--paper);
}
.tg {
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 9px 18px;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
    line-height: 1.2;
}
.tg + .tg { border-left: 1.5px solid var(--line); }
.tg:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.tg[aria-pressed="true"][data-val="yes"] { background: var(--accent); color: #fff; }
.tg[aria-pressed="true"][data-val="no"]  { background: var(--ink); color: #fff; }
.tg:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -2px; }
.toggle.is-disabled { opacity: 0.45; pointer-events: none; }

.table-status {
    margin-top: 16px; font-size: 0.9rem; font-weight: 500;
    color: var(--alert); min-height: 1.4em; line-height: 1.6;
}

/* ---------- Rights ---------- */
.rights-card {
    margin-top: 50px; padding: 34px;
    border: 1px solid var(--line); border-radius: 15px; background: var(--paper-2);
}
.rights-h { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.15rem; margin-bottom: 20px; }
.rights-list {
    list-style: none; display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px 26px; margin: 0; padding: 0;
}
.rights-list li { padding-left: 15px; border-left: 2px solid var(--accent); }
.r-name { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 3px; }
.r-desc { font-size: 0.87rem; color: var(--ink-body); line-height: 1.55; }
.rights-foot {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
    font-size: 0.9rem; color: var(--ink-soft);
}
.rights-foot a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Verify ---------- */
.verify-box {
    padding: 34px; border: 1px solid var(--line); border-radius: 15px;
    background: var(--paper-2); max-width: 520px;
}
.verify-sent { font-size: 0.94rem; color: var(--ink-body); margin-bottom: 24px; }
.linkish {
    font-family: inherit; font-size: inherit;
    background: none; border: none; padding: 0;
    color: var(--accent); font-weight: 600; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.otp-label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 10px; }
.otp-input {
    font-family: inherit; font-size: 1.7rem; font-weight: 600;
    letter-spacing: 0.4em; text-align: center;
    width: 100%; padding: 14px;
    border: 1.5px solid var(--line); border-radius: 10px;
    background: var(--paper); color: var(--ink);
}
.otp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,112,107,0.12); }
.otp-input.is-bad { border-color: var(--alert); }
.verify-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn-ghost {
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    padding: 15px 22px; border-radius: 10px;
    background: transparent; border: 1.5px solid var(--line);
    color: var(--ink-soft); cursor: pointer;
}
.btn-ghost:disabled { opacity: 0.5; cursor: default; }
.btn-ghost:not(:disabled):hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Panel 0 — the two ways in ---------- */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.choice {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 32px; text-align: left; cursor: pointer;
    font-family: inherit;
    border: 1.5px solid var(--line); border-radius: 16px;
    background: var(--paper-2);
    transition: border-color .18s ease, transform .15s ease;
}
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice-title { font-family: "Fraunces", serif; font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.choice-desc { color: var(--ink-body); font-size: 0.95rem; line-height: 1.6; }
.choice-go { margin-top: 6px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }

/* ---------- Panel 4 — catalog ---------- */
.catalog { display: grid; gap: 12px; margin-bottom: 26px; }
.catalog-loading { color: var(--ink-soft); font-size: 0.95rem; }
.cat-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 20px 22px; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 12px;
    background: var(--paper-2);
    transition: border-color .16s ease, background .16s ease;
}
.cat-item:hover { border-color: var(--ink-soft); }
.cat-item.is-on { border-color: var(--accent); background: rgba(22,112,107,0.04); }
.cat-item input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.cat-body { display: flex; flex-direction: column; gap: 4px; }
.cat-title { font-weight: 600; font-size: 1.02rem; }
.cat-blurb { color: var(--ink-body); font-size: 0.9rem; line-height: 1.5; }
.catalog-note { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 8px; }
.token-clock { color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Done / receipt ---------- */
.done-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 40px; }
.dl-meta { font-size: 0.88rem; color: var(--ink-soft); }

.receipt {
    padding: 28px; border: 1px solid var(--line); border-radius: 15px;
    background: var(--paper-2); margin-bottom: 34px;
}
.receipt-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.receipt-h { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.12rem; }
.receipt-sub { font-size: 0.9rem; color: var(--ink-body); margin-bottom: 20px; max-width: 72ch; line-height: 1.6; }
.receipt-body {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.79rem; line-height: 1.75; color: var(--ink-soft);
    background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
    padding: 20px; overflow-x: auto; white-space: pre; margin: 0;
}
.done-next { color: var(--ink-body); max-width: 72ch; line-height: 1.7; }
.done-next strong { color: var(--ink); }
.done-links { margin-top: 18px; font-size: 0.92rem; }
.done-links a { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Accessibility ---------- */
.tg:focus-visible,
.choice:focus-visible,
.linkish:focus-visible,
.btn-ghost:focus-visible {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
}


/* --- five columns now: collect / purpose / retention / required / choice --- */
.ctable-head,
.crow {
    grid-template-columns: 1fr 2.1fr 0.75fr 0.6fr 0.85fr;
}

/* Data element group — one header, several purpose rows beneath */
.cgroup { border-bottom: 1px solid var(--line); }
.cgroup:last-child { border-bottom: none; }
.cgroup-head {
    padding: 16px 26px 6px;
    font-weight: 600; font-size: 0.95rem; color: var(--ink);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.cgroup .crow { border-bottom: 1px solid var(--line); }
.cgroup .crow:last-child { border-bottom: none; }

/* the tree branch, so a purpose reads as belonging to its data element */
.c-what--child {
    padding-left: 18px; position: relative;
    color: var(--ink-body);; font-size: 0.9rem;
}
.c-what--child::before {
    content: "└"; position: absolute; left: 0; top: 0;
    color: var(--line); font-size: 0.95rem;
}
.crow:not(:last-child) .c-what--child::before { content: "├"; }

/* Retention with the calendar */


.c-keep {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.keep-icon {
    width: 16px;
    height: 16px;

    flex: 0 0 auto;

    background-image: var(--cal-icon);

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
.keep-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 500;
    padding: 4px 10px; border-radius: 6px;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
    white-space: nowrap;
}
:root {
    --cal-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='3' fill='white' stroke='%23D0D7DE' stroke-width='1.2'/%3E%3Crect x='3' y='5' width='18' height='5' rx='3' fill='%234285F4'/%3E%3Ccircle cx='8' cy='13' r='1.2' fill='%23666'/%3E%3Ccircle cx='12' cy='13' r='1.2' fill='%23666'/%3E%3Ccircle cx='16' cy='13' r='1.2' fill='%23666'/%3E%3Ccircle cx='8' cy='17' r='1.2' fill='%23666'/%3E%3Ccircle cx='12' cy='17' r='1.2' fill='%23666'/%3E%3Ccircle cx='16' cy='17' r='1.2' fill='%23666'/%3E%3C/svg%3E");
}
/* Required column */
.c-req {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;

    padding: 5px 12px;

    border-radius: 6px;
    border: 1px solid transparent;

    font-size: 0.76rem;
    font-weight: 600;

    white-space: nowrap;

    color: var(--ink);
}

.c-req.is-req {
    background: var(--required-bg);
    border-color: var(--required-line);
}

.c-req.is-opt {
    background: var(--optional-bg);
    border-color: var(--optional-line);
}

/* Section headings on the notice panel */
.sec-h {
    font-family: "Fraunces", Georgia, serif; font-weight: 500;
    font-size: 1.35rem; margin-bottom: 10px;
}
.sec-note { color: var(--ink-body); font-size: 0.92rem; line-height: 1.65; max-width: 78ch; margin-bottom: 22px; }

@media (max-width: 980px) {
    .ctable-head { display: none; }
    .crow { grid-template-columns: 1fr; gap: 14px; padding: 22px 20px; }
    .c-keep, .c-choice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
    .rights-list { grid-template-columns: 1fr 1fr; }
    .notice-meta li { grid-template-columns: 1fr; gap: 3px; }
    .cgroup-head { padding: 14px 20px 4px; }
    .c-what--child { padding-left: 0; }
    .c-what--child::before { content: none !important; }
    .c-req { display: flex; align-items: center; gap: 12px; }
}

@media (max-width: 860px) {
    .field-grid { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: 1fr; }
    .cpanel-actions { flex-direction: column; align-items: stretch; }
    .cpanel-actions .btn-primary,
    .cpanel-actions .btn-secondary { width: 100%; text-align: center; }
    .token-clock { text-align: center; margin-top: 4px; }
}

@media (max-width: 560px) {
    .rights-list { grid-template-columns: 1fr; }
    .steps { gap: 7px; }
    .step-name { display: none; }
    .step { padding: 7px; }
    .verify-actions { flex-direction: column; }
    .verify-actions .btn-primary, .verify-actions .btn-ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .cpanel { animation: none; }
}