/* ScanSell POS legal website.
   Colours follow the app palette (lib/app/theme/app_palette.dart):
   teal primary, restrained amber accent, slate text on a light neutral. */

:root {
  --teal-900: #134e4a;
  --teal-800: #115e59;
  --teal-700: #0f766e;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --amber-700: #b45309;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;
  --red-700: #b91c1c;
  --red-50: #fef2f2;
  --green-700: #15803d;
  --green-50: #f0fdf4;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 4px 16px rgb(15 23 42 / 0.05);
  --focus: 0 0 0 3px var(--surface), 0 0 0 6px var(--amber-600);
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-900);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  margin: 0 0 0.5rem;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.7rem);
  margin: 0 0 0.75rem;
  font-weight: 750;
}

h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  font-weight: 700;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

strong {
  font-weight: 650;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--teal-900);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* ---------- Setup banner (shown by main.js only while placeholders remain) ---------- */

.setup-banner {
  background: var(--amber-100);
  border-bottom: 1px solid #fcd34d;
  color: #78350f;
  font-size: 0.95rem;
  padding: 0.6rem 0;
}

.setup-banner p {
  margin: 0;
}

mark.placeholder {
  background: var(--amber-100);
  color: #78350f;
  outline: 1px dashed var(--amber-600);
  border-radius: 4px;
  padding: 0 0.2em;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.brand span small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--teal-50);
  color: var(--teal-900);
}

.site-nav a[aria-current="page"] {
  background: var(--teal-100);
  color: var(--teal-900);
}

@media (max-width: 560px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.6rem 0 0.5rem;
  }
  .site-nav ul {
    justify-content: stretch;
  }
  .site-nav li {
    flex: 1;
  }
  .site-nav a {
    width: 100%;
    justify-content: center;
    padding-inline: 0.5rem;
  }
  html {
    scroll-padding-top: 140px;
  }
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(900px 300px at 85% -20%, rgb(13 148 136 / 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface), var(--bg));
  border-bottom: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-700);
  margin-bottom: 0.75rem;
}

.hero .lead {
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.22rem);
  color: var(--ink-2);
  max-width: 62ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--ink-3);
}

.hero-meta li + li {
  margin-top: 0;
}

.hero-meta strong {
  color: var(--ink-2);
}

.hero-home {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  align-items: center;
}

.hero-home img {
  width: clamp(84px, 14vw, 128px);
  height: auto;
  border-radius: 24%;
  box-shadow: 0 12px 32px rgb(15 118 110 / 0.25);
}

@media (max-width: 560px) {
  .hero-home {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: var(--teal-700);
  color: #fff;
}

.button:hover {
  background: var(--teal-900);
  color: #fff;
}

.button.secondary {
  background: var(--surface);
  color: var(--teal-900);
  border-color: #99f6e4;
}

.button.secondary:hover {
  background: var(--teal-50);
}

.button.danger {
  background: var(--red-700);
}

.button.danger:hover {
  background: #991b1b;
}

.button.small {
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  font-size: 0.93rem;
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- Content sections ---------- */

.section {
  padding: clamp(2rem, 5vw, 3.25rem) 0;
}

.section + .section {
  padding-top: 0;
}

.section-intro {
  color: var(--ink-2);
  max-width: 65ch;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

.card-link:hover {
  border-color: #5eead4;
  transform: translateY(-2px);
}

.card-link h2 a {
  text-decoration: none;
  color: var(--ink);
}

.card-link h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card-link h2 a:focus-visible {
  box-shadow: none;
}

.card-link:focus-within {
  box-shadow: var(--focus);
}

.card-link .more {
  margin-top: auto;
  font-weight: 650;
  color: var(--teal-700);
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--teal-100);
  color: var(--teal-900);
  margin-bottom: 0.9rem;
}

.icon-badge.amber {
  background: var(--amber-100);
  color: var(--amber-700);
}

.icon-badge svg {
  width: 24px;
  height: 24px;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
}

.facts li {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-700);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: 0.98rem;
  color: var(--ink-2);
}

.facts li.amber {
  border-left-color: var(--amber-600);
}

.facts strong {
  display: block;
  color: var(--ink);
  margin-bottom: 0.15rem;
}

/* ---------- Policy layout with table of contents ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) 0 4rem;
}

.toc {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  font-size: 0.92rem;
}

.toc h2 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.6rem;
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--line);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.9rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  text-decoration: none;
  line-height: 1.4;
}

.toc a:hover {
  color: var(--teal-900);
  border-left-color: #5eead4;
}

.toc a.active {
  color: var(--teal-900);
  font-weight: 650;
  border-left-color: var(--teal-700);
}

.toc-mobile {
  display: none;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc {
    display: none;
  }
  .toc-mobile {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
  }
  .toc-mobile summary {
    cursor: pointer;
    font-weight: 650;
    padding: 0.85rem 1rem;
    min-height: 44px;
  }
  .toc-mobile ol {
    margin: 0;
    padding: 0 1rem 1rem 2.4rem;
    font-size: 0.97rem;
  }
}

.doc {
  max-width: 74ch;
}

.doc > section {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.doc > section:last-child {
  border-bottom: 0;
}

.doc h2 {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}

.doc h2 .num {
  flex: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: 8px;
  padding: 0.05rem 0.5rem;
  transform: translateY(-2px);
}

.doc p,
.doc li {
  color: var(--ink-2);
}

/* ---------- Callouts ---------- */

.callout {
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--teal-100);
  background: var(--teal-50);
  color: var(--ink-2);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout strong:first-child {
  color: var(--ink);
}

.callout.amber {
  border-color: #fde68a;
  background: var(--amber-50);
}

.callout.red {
  border-color: #fecaca;
  background: var(--red-50);
}

.callout.highlight {
  border: 2px solid var(--teal-700);
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

caption {
  text-align: left;
  font-weight: 650;
  padding: 0.85rem 1rem 0.25rem;
  color: var(--ink);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  background: var(--bg);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 650;
  color: var(--ink);
  min-width: 11rem;
}

td {
  color: var(--ink-2);
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-bottom: 0.25rem;
}

.tag.deleted {
  background: #fee2e2;
  color: #991b1b;
}

.tag.kept {
  background: var(--amber-100);
  color: #92400e;
}

.tag.left {
  background: var(--teal-100);
  color: var(--teal-900);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 1.25rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.1rem 3.1rem;
  margin: 0;
  color: var(--ink-2);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-700);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.05rem - 1px);
  top: 2.2rem;
  bottom: 0.15rem;
  width: 2px;
  background: var(--teal-100);
}

.ui {
  display: inline-block;
  font-weight: 650;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 0.4em;
  font-size: 0.95em;
  white-space: nowrap;
}

/* ---------- Form ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.35rem;
}

.field .hint {
  display: block;
  font-size: 0.93rem;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}

.field input[type="email"] {
  width: 100%;
  max-width: 28rem;
  font: inherit;
  min-height: 48px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.field input[type="email"]:focus-visible {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgb(15 118 110 / 0.25);
}

.field input[aria-invalid="true"] {
  border-color: var(--red-700);
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}

.check input {
  width: 22px;
  height: 22px;
  margin: 0.15rem 0 0;
  accent-color: var(--teal-700);
  cursor: pointer;
}

.error-text {
  display: block;
  color: var(--red-700);
  font-size: 0.93rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.error-text:empty {
  display: none;
}

.status {
  margin-top: 1.25rem;
}

.status:empty {
  display: none;
}

.status .callout {
  margin: 0;
}

.status .callout.success {
  border-color: #bbf7d0;
  background: var(--green-50);
}

.status code,
.reference {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.95em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.05em 0.4em;
  word-break: break-all;
}

.status pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  max-height: 16rem;
  overflow: auto;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--teal-900);
  color: #ccfbf1;
  padding: 2.5rem 0 2rem;
  font-size: 0.95rem;
}

.site-footer a {
  color: #fff;
}

.site-footer a:hover {
  color: var(--teal-100);
}

.site-footer :focus-visible {
  box-shadow: 0 0 0 3px var(--teal-900), 0 0 0 6px #fbbf24;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.site-footer h2 {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.6rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 0.4rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgb(204 251 241 / 0.2);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: 0.88rem;
  color: #99f6e4;
}

.footer-bottom p {
  margin: 0;
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .toc-mobile,
  .setup-banner,
  .skip-link {
    display: none !important;
  }
  .doc-layout {
    display: block;
  }
  body {
    background: #fff;
  }
}

.form-note {
  margin: 0.75rem 0 0;
  color: var(--ink-3);
  font-size: 0.93rem;
}

.noscript-note {
  margin-top: 1rem;
}

/* The status region receives focus programmatically so screen readers
   announce it; it is not interactive, so no focus ring. */
.status:focus {
  box-shadow: none;
}
