/* KL loyalty sign-up — mobile-first, 18 px base, high contrast.
   Brand: navy #013765 (KL primary), gold #B8935E used only as a decorative rule (never text).
   Contrast (computed, WCAG 2.x relative luminance): ink #1A1A1A on #FFFFFF 17.4:1; navy on
   white 12.1:1; #40526B hints/borders on white 8.0:1; error #B00020 on white 7.3:1. */
:root {
  --navy: #013765;
  --navy-hover: #0a4a80;
  --gold: #B8935E;
  --ink: #1a1a1a;
  --ink-2: #40526b;
  --paper: #ffffff;
  --ground: #f5f5f0;
  --line: #40526b;
  --bad: #b00020;
  --bad-soft: #fdecee;
  --focus: #013765;
  --radius: 10px;
}

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

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.brandbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 16px;
  border-bottom: 4px solid var(--gold);
}
.brand { margin: 0; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  background: var(--paper);
  min-height: calc(100vh - 60px);
}

h1 { font-size: 1.6rem; line-height: 1.25; color: var(--navy); margin: 0.3rem 0 0.6rem; }
h2 { font-size: 1.3rem; line-height: 1.3; color: var(--navy); margin: 0 0 0.5rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; color: var(--navy); }
p { margin: 0 0 0.8rem; }
.intro { font-size: 1.1rem; }
.note, .small { font-size: 0.9rem; color: var(--ink-2); }

.field { margin: 0 0 1.25rem; border: 0; padding: 0; min-width: 0; }
fieldset.field > legend, .field > label { display: block; font-weight: 700; margin-bottom: 0.25rem; padding: 0; }
.opt { font-weight: 400; color: var(--ink-2); }
.hint { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 0.35rem; }

input[type="text"], input[type="email"], input[type="tel"], select {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 15px) 50%;
  background-size: 7px 7px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
input:focus-visible, select:focus-visible, button:focus-visible, .check input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[aria-invalid="true"] { border-color: var(--bad) !important; border-width: 3px !important; }

.dob { display: grid; grid-template-columns: 5fr 9fr 6fr; gap: 10px; }
.dob-part label { display: block; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 0.2rem; }

.err {
  color: var(--bad);
  font-weight: 600;
  margin: 0.4rem 0 0;
  padding-left: 1.6rem;
  position: relative;
}
.err::before {
  content: "!";
  position: absolute; left: 0; top: 0.15rem;
  width: 1.15rem; height: 1.15rem; line-height: 1.15rem;
  border-radius: 50%;
  background: var(--bad); color: #fff;
  text-align: center; font-size: 0.8rem; font-weight: 800;
}

.alert {
  border: 2px solid var(--bad);
  background: var(--bad-soft);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 0 0 1.2rem;
  font-weight: 600;
}
.alert p { margin: 0 0 0.4rem; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert li { margin: 0.2rem 0; }
.alert a { color: var(--bad); text-decoration: underline; text-underline-offset: 3px; }

.consents { border: 0; padding: 0; margin: 1.6rem 0 0.4rem; border-top: 1px solid #d9d9d0; padding-top: 1.2rem; }
.check { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; align-items: start; }
.check input[type="checkbox"] {
  width: 30px; height: 30px; margin: 2px 0 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.check label { font-weight: 400; cursor: pointer; }
.check .err { grid-column: 1 / -1; }

.linklike {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.turnstile { margin: 1.2rem 0; min-height: 65px; }

.btn {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--navy-hover); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn-secondary { background: #fff; color: var(--navy); margin-top: 1.5rem; }
.btn-secondary:hover { background: #eef3f8; }

.result { padding-top: 0.5rem; }
.result:focus { outline: none; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

dialog {
  width: min(640px, 100vw - 16px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  color: var(--ink);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.legal-inner { padding: 20px 16px; }
.legal-inner p { font-size: 0.95rem; }

/* Server-rendered confirm pages (Worker) reuse these classes. */
.center { text-align: left; }

/* ---------- Embedded in the eshop page (iframe, or ?embed=1 for testing) ----------
   Follows the live storefront theme (kafekopteialoumidi.gr, theme t/26): ground #f7f6f2, body text
   #565656, headings and links navy #15315a, gold #86754d rules, square fields, uppercase letter-spaced
   buttons. The store's typeface is Cocomat Pro, a commercial font; Manrope (SIL OFL 1.1, fonts/OFL.txt)
   is the open stand-in, self-hosted because the CSP allows fonts from 'self' only.
   Contrast on #f7f6f2: #565656 6.9:1, #15315a 12:1, #6a6a6a 5.0:1, #d02e2e 4.6:1, field border #8c8577 3.5:1. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-greek.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html.embedded {
  --navy: #15315a;
  --navy-hover: #1f4883;
  --gold: #86754d;
  --ink: #1c1d1d;
  --ink-2: #6a6a6a;
  --line: #8c8577;
  --bad: #d02e2e;
  --bad-soft: #fff6f6;
  --focus: #15315a;
  --radius: 0;
  font-size: 17px;
  background: transparent;
}
.embedded body {
  background: transparent;
  color: #565656;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-weight: 500;
  line-height: 1.56;
}
.embedded .brandbar { display: none; }
.embedded .wrap { max-width: 560px; min-height: 0; padding: 8px 4px 24px; background: transparent; }

.embedded h1 { font-size: 2rem; font-weight: 600; line-height: 1.2; text-align: center; margin: 0 0 0.9rem; }
.embedded h1::after { content: ""; display: block; width: 50px; margin: 0.9rem auto 0; border-top: 2px solid var(--gold); }
.embedded h2, .embedded h3 { font-weight: 700; }
.embedded .intro, .embedded .note, .embedded .result { text-align: center; }
.embedded .intro { font-size: 1.06rem; margin-bottom: 0.4rem; }
.embedded .note { margin-bottom: 1.6rem; }

.embedded fieldset.field > legend, .embedded .field > label { color: #333; font-weight: 700; }
.embedded .check label { color: #565656; font-weight: 500; }

.embedded input[type="text"], .embedded input[type="email"], .embedded input[type="tel"], .embedded select {
  min-height: 50px;
  padding: 10px 12px;
  font-size: 1.06rem;
  font-weight: 500;
  border-width: 1px;
}
.embedded select { padding-right: 40px; }
.embedded input:focus-visible, .embedded select:focus-visible { border-color: var(--navy); outline: 2px solid var(--focus); outline-offset: 0; }
.embedded [aria-invalid="true"] { border-width: 2px !important; background-color: var(--bad-soft); }
.embedded .err::before { font-family: system-ui, sans-serif; }
.embedded .alert { border-width: 1px; font-weight: 600; }

.embedded .consents { border-top-color: #ddd8cb; }
.embedded .check { grid-template-columns: 22px 1fr; column-gap: 12px; }
.embedded .check input[type="checkbox"] { width: 22px; height: 22px; margin: 2px 0 0; }

.embedded .btn {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-width: 1px;
}
.embedded .btn-secondary { background: transparent; border-width: 2px; }
.embedded .btn-secondary:hover { background: rgba(21, 49, 90, 0.06); }
.embedded .result h1 { margin-top: 0.5rem; }
.embedded .result .btn-secondary { max-width: 360px; margin: 1.6rem auto 0; }

/* The iframe is sized to its content, so the modal is placed next to the link that opened it (app.js). */
.embedded dialog { bottom: auto; margin: 0 auto; max-height: min(560px, calc(100vh - 32px)); border-width: 1px; background: #fff; }
