/* ==================================================================
   Patient dashboard. Loaded only by dashboard.html — the marketing page
   never pulls this in.
   ================================================================== */
.dash-body { background: var(--colors-neutral--100); margin: 0; }
.dash {
  font-family: "Greycliff CF", Arial, sans-serif;
  color: var(--colors-sage--500);
  min-height: 100vh;
}

/* --- top bar ------------------------------------------------------- */
.dash-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.25rem clamp(1.25rem, 4vw, 4rem);
  background: var(--colors-all--white); border-bottom: 1px solid var(--colors-all--light-gray);
  position: sticky; top: 0; z-index: 20;
}
.dash-brand { text-decoration: none; color: inherit; }
.dash-topbar-right { display: flex; align-items: center; gap: 1.25rem; }
.dash-back { font-size: 0.9375rem; color: var(--colors-sage--400); text-decoration: none; }
.dash-back:hover { color: var(--colors-sage--500); text-decoration: underline; }
.dash-logout {
  border: 1.5px solid var(--colors-all--light-gray); background: none;
  border-radius: 100px; padding: 0.5rem 1.1rem; font-size: 0.875rem; font-weight: 600;
  color: var(--colors-sage--500); cursor: pointer;
}
.dash-logout:hover { border-color: var(--colors-sage--300); }
.dash-logout[hidden] { display: none; }

/* --- login --------------------------------------------------------- */
.dash-login { display: grid; place-items: center; padding: clamp(2rem, 8vw, 6rem) 1.25rem; }
.dash-login[hidden] { display: none; }
.dash-login-card {
  width: 100%; max-width: 27rem; background: var(--colors-all--white);
  border-radius: 1.5rem; padding: clamp(1.75rem, 4vw, 2.75rem);
  box-shadow: 0 24px 60px -40px rgba(25, 50, 49, 0.5);
}
.dash-login-title {
  font-family: "Quincy CF", Georgia, serif; font-size: 2rem; line-height: 1.1; margin: 0;
}
.dash-login-lead { color: var(--colors-sage--400); margin: 0.75rem 0 1.75rem; font-size: 0.9375rem; }
.dash-demo-note {
  margin: 1.25rem 0 0; font-size: 0.75rem; line-height: 1.55; color: var(--colors-sage--300);
}

/* --- shared form bits ---------------------------------------------- */
.dash-label {
  display: block; font-size: 0.875rem; font-weight: 600;
  color: var(--colors-sage--500); margin: 0 0 0.4rem;
}
.dash-input {
  width: 100%; box-sizing: border-box; padding: 0.85rem 1rem; margin-bottom: 1rem;
  border: 1.5px solid var(--colors-all--light-gray); border-radius: 0.75rem;
  background: var(--colors-neutral--100); font-size: 1rem; color: var(--colors-sage--500);
  font-family: inherit;
}
.dash-input::placeholder { color: var(--colors-neutral--300); }
.dash-input:focus {
  outline: none; border-color: var(--colors-grass--500); background: var(--colors-all--white);
  box-shadow: 0 0 0 3px rgba(20, 125, 87, 0.13);
}
.dash-block { width: 100%; justify-content: center; }
.dash-error {
  margin: 0 0 0.9rem; font-size: 0.875rem; color: #c0563a;
}
.dash-error[hidden] { display: none; }

/* --- main ---------------------------------------------------------- */
.dash-main {
  max-width: 74rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 4rem) 5rem;
}
.dash-main[hidden] { display: none; }
.dash-h1 { font-family: "Quincy CF", Georgia, serif; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.1; margin: 0; }
.dash-h2 { font-family: "Quincy CF", Georgia, serif; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.15; margin: 0 0 0.5rem; }
.dash-h3 { font-size: 1.0625rem; font-weight: 600; margin: 0 0 1rem; }
.dash-sub { color: var(--colors-sage--400); margin: 0.5rem 0 0; font-size: 0.9375rem; line-height: 1.6; }

.dash-hello { margin-bottom: 2rem; }

/* --- status -------------------------------------------------------- */
.dash-status { margin-bottom: 3rem; }
.dash-status-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--colors-grass--500); color: var(--colors-all--white);
  border-radius: 1.25rem; padding: 1.5rem 1.75rem;
}
.dash-status-icon {
  flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; background: rgba(255, 255, 255, 0.18);
}
.dash-status-icon svg { width: 1.15rem; height: 1.15rem; }
.dash-status-title { font-weight: 600; margin: 0; }
.dash-status-body { margin: 0.35rem 0 0; font-size: 0.9375rem; opacity: 0.92; line-height: 1.55; }

.dash-facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin: 1px 0 0; background: var(--colors-all--light-gray);
  border-radius: 1.25rem; overflow: hidden;
}
.dash-facts > div { background: var(--colors-all--white); padding: 1.25rem 1.5rem; }
.dash-facts dt { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--colors-sage--300); }
.dash-facts dd { margin: 0.4rem 0 0; font-weight: 600; }

/* --- plans --------------------------------------------------------- */
.dash-order-lead { max-width: 46rem; margin-bottom: 2rem; }
.dash-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.dash-plan {
  position: relative; display: flex; flex-direction: column; text-align: left;
  background: var(--colors-all--white); border: 2px solid var(--colors-all--light-gray);
  border-radius: 1.25rem; padding: 1.5rem 1.35rem; cursor: pointer; font-family: inherit;
  color: inherit; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.dash-plan:hover { border-color: var(--colors-sage--300); transform: translateY(-2px); }
.dash-plan.is-selected {
  border-color: var(--colors-grass--500);
  box-shadow: 0 0 0 4px rgba(20, 125, 87, 0.12);
}
.dash-plan.is-best { border-color: var(--colors-sage--500); }
.dash-plan.is-best.is-selected { border-color: var(--colors-grass--500); }
.dash-plan-badge {
  position: absolute; top: -0.7rem; left: 1.35rem;
  background: var(--colors-sage--500); color: var(--colors-neutral--100);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.3rem 0.7rem; border-radius: 100px;
}
.dash-plan-term { font-family: "Quincy CF", Georgia, serif; font-size: 1.6rem; line-height: 1; }
.dash-plan-per { display: block; margin-top: 0.75rem; font-size: 0.9375rem; color: var(--colors-sage--400); }
.dash-plan-per strong { font-size: 1.35rem; color: var(--colors-sage--500); }
.dash-plan-total { display: block; margin-top: 0.25rem; font-size: 0.875rem; color: var(--colors-sage--300); }
.dash-plan-save {
  display: block; margin-top: 0.6rem; font-size: 0.8125rem; font-weight: 600;
  color: var(--colors-grass--500);
}
.dash-plan-save.is-blank { visibility: hidden; }
.dash-plan-includes {
  display: block; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--colors-all--light-gray);
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--colors-sage--300);
}
.dash-plan-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.dash-plan-list li {
  position: relative; padding-left: 0.9rem; margin-bottom: 0.35rem;
  font-size: 0.8125rem; line-height: 1.45; color: var(--colors-sage--400);
}
.dash-plan-list li::before {
  content: ''; position: absolute; left: 0; top: 0.5rem;
  width: 4px; height: 4px; border-radius: 50%; background: var(--colors-sage--200);
}
.dash-plan-cta {
  margin-top: auto; padding-top: 1.25rem;
  font-size: 0.9375rem; font-weight: 600; color: var(--colors-grass--500);
}
.dash-plan.is-selected .dash-plan-cta::before { content: '\2713\00a0'; }

/* --- checkout ------------------------------------------------------ */
.dash-checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; }
.dash-checkout-left, .dash-summary {
  background: var(--colors-all--white); border-radius: 1.25rem; padding: 1.75rem;
}
.dash-addr-row { display: grid; grid-template-columns: 1fr 2fr; gap: 1rem; }
.dash-summary-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0; font-size: 0.9375rem; color: var(--colors-sage--400);
}
.dash-summary-row strong { color: var(--colors-sage--500); text-align: right; }
.dash-summary-row[hidden] { display: none; }
.dash-summary-save strong { color: var(--colors-grass--500); }
.dash-summary-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0.75rem 0 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--colors-all--light-gray); font-weight: 600;
}
.dash-summary-total strong { font-size: 1.6rem; }
.dash-summary-note { margin: 0.9rem 0 0; font-size: 0.75rem; color: var(--colors-sage--300); text-align: center; }

/* --- confirmation -------------------------------------------------- */
.dash-done[hidden] { display: none; }
.dash-done-card {
  background: var(--colors-all--white); border-radius: 1.5rem;
  padding: clamp(2rem, 5vw, 3.5rem); text-align: center;
}
.dash-done-icon {
  display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 1.25rem;
  border-radius: 50%; background: var(--colors-sage--100); color: var(--colors-grass--500);
}
.dash-done-icon svg { width: 1.6rem; height: 1.6rem; }
.dash-done-ref { margin: 1.25rem 0 1.75rem; font-size: 0.9375rem; color: var(--colors-sage--400); }
.dash-done-ref strong { font-family: monospace; font-size: 1.05rem; color: var(--colors-sage--500); }

/* --- history ------------------------------------------------------- */
.dash-history { margin-top: 3.5rem; }
.dash-table-wrap { overflow-x: auto; margin-top: 1.25rem; }
.dash-table-wrap[hidden] { display: none; }
.dash-table { width: 100%; border-collapse: collapse; background: var(--colors-all--white); border-radius: 1.25rem; overflow: hidden; }
.dash-table th, .dash-table td { padding: 1rem 1.25rem; text-align: left; font-size: 0.9375rem; white-space: nowrap; }
.dash-table th {
  font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--colors-sage--300); border-bottom: 1px solid var(--colors-all--light-gray); font-weight: 600;
}
.dash-table tbody tr + tr td { border-top: 1px solid var(--colors-all--light-gray); }
.dash-pill {
  display: inline-block; padding: 0.25rem 0.7rem; border-radius: 100px;
  background: var(--colors-sage--100); color: var(--colors-sage--500);
  font-size: 0.8125rem; font-weight: 600;
}

.dash-note {
  max-width: 60rem; margin: 3.5rem auto 0; text-align: center;
  font-size: 0.75rem; line-height: 1.6; color: var(--colors-sage--300);
}

/* --- SEPA mandate --------------------------------------------------- */
.dash-mandate[hidden] { display: none; }

/* ---- pending-eligibility panel */
.dash-status-card--pending { background: var(--colors-neutral--100); color: inherit; }
.dash-status-card--pending .dash-status-icon { background: rgba(0, 0, 0, 0.06); }
.dash-status-cta { display: inline-flex; margin-top: 0.9rem; }
.dash-done-icon--wait { background: rgba(0, 0, 0, 0.06); color: inherit; }

/* ---- account cards */
.dash-alt { margin: 0.85rem 0 0; font-size: 0.9rem; text-align: center; }
.dash-linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--colors-grass--600);
  text-decoration: underline; cursor: pointer;
}
.dash-linkbtn + .dash-linkbtn { margin-left: 0.85rem; }
.dash-hint { margin: 0.35rem 0 0.9rem; font-size: 0.8rem; color: var(--colors-neutral--600); }
.dash-ok {
  margin: 0.75rem 0 0; padding: 0.6rem 0.9rem; border-radius: 0.4rem;
  background: rgba(20, 125, 87, 0.1); color: var(--colors-grass--600); font-size: 0.9rem;
}
.dash-ok[hidden], .dash-error[hidden] { display: none; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* ---- pre-contractual block at checkout (L.221-5) */
.dash-precontract {
  margin: 1.25rem 0 1rem; padding: 0.9rem 1rem;
  background: var(--colors-neutral--100); border-radius: 0.5rem; font-size: 0.85rem;
  line-height: 1.5;
}
.dash-precontract-title { margin: 0 0 0.5rem; font-weight: 600; }
.dash-precontract-list { margin: 0; padding-left: 1.1rem; }
.dash-precontract-list li + li { margin-top: 0.4rem; }
.dash-precontract-links { margin: 0.7rem 0 0; }
.dash-muted { color: var(--colors-neutral--600); font-size: 0.85rem; }
.dash-data-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

/* WCAG 2.4.11: the old focus ring was a 1.18:1 shadow, effectively invisible. */
.dash-input:focus-visible,
.dash-linkbtn:focus-visible,
.dash-check input:focus-visible,
.btn:focus-visible,
.dash-mandate-cta:focus-visible {
  outline: 3px solid var(--colors-grass--600);
  outline-offset: 2px;
}

/* The mandate wording is legally mandatory text; 3.06:1 was not readable. */
.dash-mandate-text {
  color: var(--colors-neutral--800, #1f2724);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-line;
}

/* ---- P1-12: on a phone the orders table becomes cards, so the status is
   visible without scrolling sideways. */
@media (max-width: 640px) {
  .dash-row { grid-template-columns: 1fr; }
  .dash-table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dash-table--cards, .dash-table--cards tbody, .dash-table--cards tr, .dash-table--cards td {
    display: block; width: 100%;
  }
  .dash-table--cards tr {
    border: 1px solid var(--colors-neutral--200); border-radius: 0.55rem;
    padding: 0.85rem 1rem; margin-bottom: 0.85rem;
  }
  .dash-table--cards td {
    display: flex; justify-content: space-between; gap: 1rem;
    border: 0; padding: 0.2rem 0; text-align: right;
  }
  .dash-table--cards td::before {
    content: attr(data-label); font-weight: 600; text-align: left;
    color: var(--colors-neutral--600); font-size: 0.8rem;
  }
  .dash-table-wrap { overflow: visible; }
}
.dash-mandate-card {
  background: var(--colors-all--white); border-radius: 1.25rem;
  padding: 1.75rem; max-width: 34rem;
}
.dash-mandate-text {
  font-size: 0.75rem; line-height: 1.6; color: var(--colors-sage--300);
  background: var(--colors-neutral--100); border-radius: 0.75rem;
  padding: 0.9rem 1rem; margin: 0.5rem 0 1rem;
}
.dash-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.875rem; margin-bottom: 1rem; cursor: pointer; }
/* the inherited Webflow reset sets appearance:none and leaves checkboxes with
   no dimensions at all — put the native control back */
.dash-check input[type="checkbox"] {
  appearance: auto; -webkit-appearance: checkbox;
  width: 1.05rem; height: 1.05rem; margin: 0.15rem 0 0; flex: none;
  accent-color: var(--colors-grass--500); cursor: pointer;
}
.dash-mandate-status {
  display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 1.5rem;
  padding: 0.5rem 0.9rem; border-radius: 100px;
  background: var(--colors-sage--100); color: var(--colors-sage--500);
  font-size: 0.875rem; font-weight: 600;
}
.dash-mandate-status[hidden] { display: none; }
.dash-mandate-ok { color: var(--colors-grass--500); }
.dash-mandate-cta {
  border: 1.5px dashed var(--colors-sage--200); background: none; cursor: pointer;
  border-radius: 100px; padding: 0.55rem 1.1rem; margin-bottom: 1.5rem;
  font-family: inherit; font-size: 0.875rem; font-weight: 600; color: var(--colors-sage--500);
}
.dash-mandate-cta[hidden] { display: none; }

/* status pills carry the SEPA lifecycle, not just one colour */
.dash-pill--awaiting_payment { background: #fdf4ec; color: #8a5320; }
.dash-pill--paid, .dash-pill--preparing { background: var(--colors-sage--100); color: var(--colors-sage--500); }
.dash-pill--shipped, .dash-pill--delivered { background: var(--colors-grass--500); color: #fff; }
.dash-pill--cancelled, .dash-pill--refunded { background: #f6e2dc; color: #8f3a22; }

@media (max-width: 1080px) {
  .dash-plans { grid-template-columns: repeat(2, 1fr); }
  .dash-facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .dash-checkout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dash-plans, .dash-facts { grid-template-columns: 1fr; }
  .dash-addr-row { grid-template-columns: 1fr; }
}
