/* ==================================================================
   Πύλη Online Ραντεβού Οχημάτων
   Τα χρώματα --brand, --brand-2, --action αντικαθίστανται από τα
   χρώματα κάθε επιχείρησης (app.js -> applyBrand).
   ================================================================== */

:root {
  /* Βάση */
  --asphalt: #22262B;
  --graphite: #5B636B;
  --concrete: #EEF0F1;
  --line: #D5D9DD;
  --paper: #FFFFFF;
  --ok: #1E7F4F;
  --error: #B3261E;
  --error-bg: #FBEDEC;

  /* Πινακίδα */
  --plate-blue: #003399;
  --plate-ink: #111418;

  /* Προεπιλογές πύλης (αλλάζουν ανά επιχείρηση) */
  --brand: #17324D;
  --brand-ink: #FFFFFF;
  --brand-2: #2B5A85;
  --action: #F2B705;
  --action-ink: #22262B;

  /* Τυπογραφία */
  --font: "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-plate: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;

  /* Αποστάσεις */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17px: άνετο στο κινητό */
  line-height: 1.5;
  color: var(--asphalt);
  background: var(--concrete);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; outline: none; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 1.375rem; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 1.0625rem; font-weight: 650; }
p { margin: 0 0 var(--s4); }
a { color: var(--brand-2); }

:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }

.skip {
  position: absolute; left: var(--s2); top: -48px;
  background: var(--paper); color: var(--asphalt); padding: var(--s2) var(--s3); border-radius: 8px; z-index: 10;
}
.skip:focus { top: var(--s2); }

.muted { color: var(--graphite); }
.small { font-size: 0.9375rem; }
[hidden] { display: none !important; }

/* ---------- Κεφαλίδα ---------- */
.masthead { background: var(--brand); color: var(--brand-ink); }
.masthead-inner {
  max-width: 1080px; margin: 0 auto; padding: var(--s3) var(--s4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4); min-height: 64px;
}
.brand { display: flex; align-items: center; gap: var(--s3); color: inherit; text-decoration: none; min-width: 0; }
.brand-logo {
  height: 40px; width: auto; max-width: 140px; object-fit: contain;
  background: var(--paper); border-radius: 6px; padding: 3px;
}
.brand-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.brand-site { font-size: 0.8125rem; color: inherit; opacity: 0.9; text-decoration: underline; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-site:hover { opacity: 1; }
.brand-name { font-weight: 650; font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-contact { font-size: 0.9375rem; text-align: right; }
.brand-contact a { color: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand-contact a:hover { text-decoration: underline; }

/* ---------- Κοινά ---------- */
.view { max-width: 1080px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s7); }
.view.narrow { max-width: 640px; }
.loading { color: var(--graphite); }
.lead { font-size: 1.125rem; color: var(--graphite); max-width: 36em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  font: inherit; font-weight: 650; text-decoration: none;
  border-radius: 10px; border: 2px solid transparent; cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--action); color: var(--action-ink); }
.btn-primary:not(:disabled):hover { filter: brightness(0.94); }
.btn-quiet { background: transparent; color: var(--asphalt); border-color: var(--line); }
.btn-quiet:not(:disabled):hover { border-color: var(--graphite); }
.btn-small { min-height: 36px; padding: 0 var(--s3); font-size: 0.9375rem; }

.link {
  font: inherit; color: var(--brand-2); background: none; border: 0; padding: 0;
  text-decoration: underline; cursor: pointer;
}
.link:disabled { color: var(--graphite); text-decoration: none; cursor: default; }

.actions { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.actions .btn-primary { margin-left: auto; }
@media (max-width: 480px) {
  .actions { flex-direction: column-reverse; }
  .actions .btn { width: 100%; }
  .actions .btn-primary { margin-left: 0; }
}

.alert {
  background: var(--error-bg); color: var(--error); border-left: 4px solid var(--error);
  padding: var(--s3) var(--s4); border-radius: 0 8px 8px 0; margin-bottom: var(--s5);
}
.alert a { color: inherit; font-weight: 650; }

/* ---------- Φόρμες ---------- */
.field { margin-bottom: var(--s4); }
.field label { display: block; font-weight: 600; margin-bottom: var(--s1); }
.optional { font-weight: 400; color: var(--graphite); }
.hint { font-size: 0.9375rem; color: var(--graphite); margin: var(--s1) 0 0; }
.field-error { font-size: 0.9375rem; color: var(--error); margin: var(--s1) 0 0; }
.field-error:empty { display: none; }

input, select, textarea {
  font: inherit; color: var(--asphalt); width: 100%;
  min-height: 48px; padding: var(--s2) var(--s3);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 25%, transparent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }
select:disabled { background: var(--concrete); color: var(--graphite); }

.row-2 { display: grid; grid-template-columns: 1fr; gap: 0 var(--s4); }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Πινακίδα (το χαρακτηριστικό στοιχείο) ---------- */
.plate {
  display: inline-flex; align-items: stretch;
  background: var(--paper); border: 2.5px solid var(--plate-ink); border-radius: 7px;
  overflow: hidden;
}
.plate-eu {
  background: var(--plate-blue); color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 5px 5px 4px; flex: none;
  font-family: var(--font-plate); font-weight: 700; line-height: 1;
}
.eu-stars { display: block; }

.plate-input { display: flex; width: 100%; max-width: 340px; }
.plate-input .plate-eu { width: 44px; font-size: 0.95rem; }
.plate-input .eu-stars { width: 24px; height: 24px; }
.plate-input input {
  border: 0; border-radius: 0; min-height: 64px; padding: 0 var(--s3);
  font-family: var(--font-plate); font-stretch: condensed; font-weight: 700;
  font-size: 2.1rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: center;
  color: var(--plate-ink); background: var(--paper);
}
.plate-input input::placeholder { color: #B7BDC3; font-weight: 600; }
.plate-input:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.plate-input input:focus { box-shadow: none; }
.plate-input.invalid { border-color: var(--error); }

.plate-mini .plate-eu { width: 22px; font-size: 0.5rem; padding: 2px; }
.plate-mini .eu-stars { width: 13px; height: 13px; }
.plate-mini .plate-text {
  font-family: var(--font-plate); font-stretch: condensed; font-weight: 700;
  font-size: 1.35rem; letter-spacing: 0.05em; color: var(--plate-ink);
  padding: 1px 10px; line-height: 1.35;
}

/* ---------- Αναζήτηση ---------- */
.search-hero { padding: var(--s4) 0 var(--s5); }
.search-hero h1 { max-width: 20em; }
.search-form { display: grid; grid-template-columns: 1fr; gap: 0 var(--s4); max-width: 720px; margin-top: var(--s5); }
@media (min-width: 640px) { .search-form { grid-template-columns: 1fr 1fr; } }

.results-status { color: var(--graphite); margin: 0 0 var(--s3); }
.results-status:empty { display: none; }
.results { list-style: none; margin: 0; padding: 0; background: var(--paper); border-radius: 12px; border: 1px solid var(--line); }
.results:empty { display: none; }
.result {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--s3) var(--s4); align-items: center;
  padding: var(--s4); border-top: 1px solid var(--line);
}
.result:first-child { border-top: 0; }
.result-logo {
  width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--line);
  object-fit: contain; background: var(--paper);
}
.result-initial {
  width: 56px; height: 56px; border-radius: 8px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 1.4rem;
}
.result-name { font-weight: 650; font-size: 1.125rem; margin: 0; }
.result-meta { color: var(--graphite); margin: 2px 0 0; font-size: 0.9375rem; }
.result-meta a { color: inherit; }
.result .btn { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .result { grid-template-columns: 56px 1fr auto; }
  .result .btn { grid-column: auto; }
}

/* ---------- Κράτηση ---------- */
.booking { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); align-items: start; }
@media (min-width: 900px) { .booking { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); } }

.wizard { min-width: 0; background: var(--paper); border-radius: 14px; padding: var(--s5) var(--s4); border: 1px solid var(--line); }
@media (min-width: 560px) { .wizard { padding: var(--s6); } }

.welcome { color: var(--graphite); margin: 0; }
.wizard-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.wizard-top .btn { margin-left: auto; }

.stepper {
  list-style: none; margin: 0 0 var(--s5); padding: 0;
  display: flex; gap: var(--s1); counter-reset: step;
}
.stepper li {
  flex: 1; counter-increment: step; font-size: 0.8125rem; color: var(--graphite);
  padding-top: var(--s2); border-top: 4px solid var(--line); min-width: 0;
}
.stepper li::before { content: counter(step) ". "; font-weight: 650; }
.stepper li.done { border-top-color: var(--brand-2); }
.stepper li[aria-current="step"] { border-top-color: var(--brand); color: var(--asphalt); font-weight: 650; }
.stepper li span { display: none; }
.step-caption { font-size: 0.9375rem; color: var(--graphite); margin: calc(-1 * var(--s3)) 0 var(--s4); }
@media (min-width: 560px) {
  .stepper li span { display: inline; }
  .step-caption { display: none; }
}

.step h2 { outline: none; margin-bottom: var(--s4); }

.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.choice {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  min-height: 60px; padding: var(--s3) var(--s4);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px;
}
.choice:hover { border-color: var(--graphite); }
.choice[aria-pressed="true"] { border: 2px solid var(--brand); box-shadow: inset 4px 0 0 var(--brand); }
.choice-title { font-weight: 600; }
.choice-meta { color: var(--graphite); font-size: 0.9375rem; white-space: nowrap; }
.choice-sub { display: block; color: var(--graphite); font-size: 0.9375rem; font-weight: 400; }

.days-nav { display: flex; justify-content: space-between; margin-bottom: var(--s2); }
.days {
  display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x proximity;
  padding: 2px 2px var(--s3); margin: 0 -2px var(--s4);
}
.day {
  flex: none; scroll-snap-align: start; width: 68px; min-height: 76px;
  font: inherit; color: inherit; cursor: pointer; text-align: center;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.day-week { font-size: 0.8125rem; color: var(--graphite); }
.day-num { font-size: 1.375rem; font-weight: 700; line-height: 1.1; }
.day-month { font-size: 0.8125rem; color: var(--graphite); }
.day:disabled { cursor: not-allowed; background: var(--concrete); opacity: 0.55; }
.day[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day[aria-selected="true"] .day-week, .day[aria-selected="true"] .day-month { color: inherit; }

.times-title { color: var(--graphite); font-weight: 600; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--s2); }
.time {
  min-height: 48px; font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer;
  background: var(--paper); color: inherit; border: 1.5px solid var(--line); border-radius: 8px;
}
.time:hover { border-color: var(--graphite); }
.time[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.review { margin: 0 0 var(--s5); display: grid; grid-template-columns: 1fr; }
.review-row { display: grid; grid-template-columns: 9.5em 1fr auto; gap: var(--s3); align-items: baseline; padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.review-row:first-child { border-top: 1px solid var(--line); }
.review dt { color: var(--graphite); font-size: 0.9375rem; }
.review dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .review-row { grid-template-columns: 1fr auto; }
  .review-row dt { grid-column: 1 / -1; }
}

.consent { display: flex; gap: var(--s3); align-items: flex-start; cursor: pointer; margin-bottom: var(--s2); }
.consent input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

.captcha { margin: var(--s4) 0; }
.captcha:empty { display: none; }

.code-input {
  max-width: 220px; font-size: 1.75rem; font-weight: 700; letter-spacing: 0.4em; text-align: center;
  font-variant-numeric: tabular-nums; padding-left: calc(var(--s3) + 0.4em);
}

/* ---------- Σύνοψη ---------- */
.summary {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: var(--s5);
}
@media (min-width: 900px) { .summary { position: sticky; top: var(--s5); } }
@media (max-width: 899px) { .summary { display: none; } }
.summary-title { font-size: 1.0625rem; margin-bottom: var(--s3); }
.summary-list { margin: 0; }
.summary-list dt { color: var(--graphite); font-size: 0.875rem; margin-top: var(--s3); }
.summary-list dd { margin: 0; font-weight: 600; }
.summary-empty { color: var(--graphite); font-size: 0.9375rem; }
#summary-plate { margin-top: var(--s4); }

/* ---------- Επιτυχία ---------- */
.success { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: var(--s6) var(--s5); }
.success h1 { outline: none; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem); }
.success-mark { width: 56px; height: 56px; margin-bottom: var(--s4); }
.success-mark circle { fill: var(--ok); }
.success-mark path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.success-label { color: var(--graphite); margin: var(--s5) 0 0; font-size: 0.9375rem; }
.success-number {
  font-size: clamp(2rem, 1.4rem + 3vw, 2.9rem); font-weight: 750; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums; margin: 0 0 var(--s4); overflow-wrap: anywhere;
}

/* ---------- Υποσέλιδο ---------- */
.footer { color: var(--graphite); font-size: 0.875rem; text-align: center; padding: var(--s5) var(--s4) var(--s6); }
.footer p { margin: 0; }
.footer a { color: inherit; }

/* ---------- Παράθυρο πολιτικής απορρήτου ---------- */
.dialog {
  width: min(720px, calc(100vw - 32px)); height: min(80vh, 760px); padding: 0;
  border: 0; border-radius: 14px; color: var(--asphalt);
}
.dialog::backdrop { background: rgba(34, 38, 43, 0.55); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.25rem; }
.dialog iframe { flex: 1; width: 100%; border: 0; background: var(--paper); }

/* ---------- Κίνηση ---------- */
.step:not([hidden]) { animation: step-in 180ms ease-out; }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

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

/* Σελίδα επιβεβαίωσης υπευθύνου */
.alert.alert-ok { background: #E6F4EC; color: #17603C; border-left-color: var(--ok); }
.wizard-top .btn + .btn { margin-left: 0; }

/* «Τα ραντεβού μου»: κάρτα ανά ραντεβού */
.appt-card { border: 1px solid var(--line); border-radius: 12px; padding: var(--s4); margin-bottom: var(--s4); background: var(--paper); }
.appt-card .review { margin-bottom: var(--s3); }

/* Βοηθός AI (chat) στη σελίδα κράτησης */
.ai-fab { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 40; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px;
  padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.ai-fab:hover { filter: brightness(1.12); }
.ai-panel { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 41; width: min(560px, calc(100vw - 2 * var(--s4))); height: min(680px, calc(100vh - 2 * var(--s4)));
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0, 0, 0, .3); overflow: hidden; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); background: var(--brand); color: var(--brand-ink); padding: var(--s3) var(--s4); }
.ai-head strong { font-size: 1rem; }
.ai-head button { background: transparent; color: inherit; border: 1px solid rgba(255, 255, 255, .5); border-radius: 8px; padding: 4px 10px; font: inherit; cursor: pointer; }
.ai-log { flex: 1; overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); background: var(--concrete); }
.ai-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.ai-msg.bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); }
.ai-msg.me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); }
.ai-msg.err { align-self: stretch; max-width: 100%; background: var(--error-bg); color: var(--error); }
.ai-msg.typing { color: var(--graphite); font-style: italic; }
.ai-note { font-size: .8125rem; color: var(--graphite); padding: 6px var(--s3) 0; }
.ai-captcha { padding: 0 var(--s3); min-height: 0; }
.ai-form { display: flex; gap: var(--s2); padding: var(--s3); border-top: 1px solid var(--line); }
.ai-form input { flex: 1; min-width: 0; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.ai-form button { font: inherit; font-weight: 600; padding: 0 16px; border: 0; border-radius: 8px; background: var(--action); color: var(--action-ink); cursor: pointer; }
.ai-form button:disabled { opacity: .5; cursor: default; }

/* ---------- Φωνητικός βοηθός ---------- */
.ai-form .ai-mic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; padding: 0; border: 1px solid var(--line, #c9d1da); background: #fff; color: #1b1f24; border-radius: 8px; cursor: pointer; }
.ai-form .ai-mic:hover { background: #f1f4f8; }
.ai-form .ai-mic.on { background: #c0392b; border-color: #c0392b; color: #fff; }
.ai-voice-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #eef6ee; border-top: 1px solid #cfe3cf; font-size: .9rem; }
.ai-voice-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e9e4f; animation: ai-voice-pulse 1.4s ease-in-out infinite; flex: none; }
.ai-voice-label { flex: 1; min-width: 0; }
.ai-voice-stop { border: 0; background: #c0392b; color: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; }
@keyframes ai-voice-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .ai-voice-dot { animation: none; } }
