:root {
  --red: #d71920;
  --red-dark: #9f1117;
  --blue: #0047ba;
  --blue-dark: #06275f;
  --ink: #111827;
  --muted: #5d6678;
  --line: #d8dde8;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --shadow: 0 18px 48px rgba(6, 39, 95, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header,
.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  width: 100vw;
  max-width: 100vw;
  color: var(--paper);
  background: var(--blue-dark);
  box-shadow: 0 8px 28px rgba(6, 39, 95, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: 0;
}

.brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  width: 28px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background:
    repeating-linear-gradient(135deg, var(--red) 0 8px, var(--paper) 8px 16px, var(--blue) 16px 24px, var(--paper) 24px 32px);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.25);
}

.top-actions,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.top-actions {
  flex: 0 0 auto;
}

.site-header .top-actions { display: none; }

.mobile-language-switch {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #092b68;
}

.mobile-language-switch a {
  min-width: 48px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 900;
}

.mobile-language-switch a.active {
  border-color: var(--red);
  background: var(--red);
}

.language-select {
  width: 74px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  color: var(--paper);
  background: var(--red);
  font-weight: 900;
}

.top-actions a,
.admin-nav a {
  min-width: 42px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.top-actions .icon-link {
  display: none;
  width: 42px;
  padding: 0;
}

.top-actions .icon-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.top-actions a.active { background: var(--red); border-color: var(--red); }

.hero {
  position: relative;
  min-height: 74vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--blue-dark);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,39,95,0.1) 0, rgba(6,39,95,0.56) 46%, rgba(6,39,95,0.92) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 36px));
  max-width: 680px;
  padding: 84px 18px 34px;
  color: var(--paper);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow { color: #ffcfdb; }

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-size: clamp(1.9rem, 8vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.08;
}

h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.hero-copy p:not(.eyebrow) {
  max-width: 36rem;
  margin: 14px 0 0;
  color: rgba(255,255,255,0.9);
  font-size: 1.05rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-badges span {
  flex: 1 1 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: var(--paper);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.booking-section,
.services-section,
.result-page {
  padding: 28px 16px;
}

.section-head,
.panel-head {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.booking-form,
.admin-form,
.login-card,
.result-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.booking-form {
  display: grid;
  gap: 15px;
  padding: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
}

textarea { resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,71,186,0.15);
}

.field-grid {
  display: grid;
  gap: 12px;
}

.time-picker {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.booking-calendar {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-toolbar h3 {
  margin: 0;
  text-align: center;
  text-transform: capitalize;
}

.calendar-nav {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--paper);
}

.calendar-nav:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.calendar-nav svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.calendar-empty {
  min-height: 54px;
}

.calendar-day {
  min-width: 0;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
}

.calendar-day strong {
  font-size: 1rem;
  line-height: 1;
}

.calendar-day span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.available {
  border-color: rgba(0, 71, 186, 0.35);
  box-shadow: inset 0 -4px 0 rgba(0, 71, 186, 0.2);
}

.calendar-day.full {
  color: var(--red-dark);
  background: #fff0f1;
  box-shadow: inset 0 -4px 0 rgba(215, 25, 32, 0.25);
}

.calendar-day.closed,
.calendar-day.past {
  color: #7a8394;
  background: #eef1f6;
}

.calendar-day:disabled {
  cursor: not-allowed;
}

.calendar-day.selected {
  color: var(--paper);
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: none;
}

.calendar-day.selected span {
  color: rgba(255,255,255,0.86);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
}

.legend-dot.available { background: var(--blue); }
.legend-dot.full { background: var(--red); }
.legend-dot.closed { background: #9aa3b2; }

.slot-grid {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.slot-grid p {
  grid-column: 1 / -1;
  margin: 6px 0;
  color: var(--muted);
}

.slot-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--paper);
  font-weight: 900;
}

.slot-button.selected {
  color: var(--paper);
  border-color: var(--blue);
  background: var(--blue);
}

.slot-grid.needs-selection {
  outline: 3px solid rgba(215,25,32,0.2);
  outline-offset: 4px;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--red);
  color: var(--paper);
  background: var(--red);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--blue);
  color: var(--blue);
  background: var(--paper);
}

.service-list {
  display: grid;
  gap: 10px;
}

.service-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: var(--paper);
}

.service-card span {
  color: var(--blue);
  font-weight: 900;
}

.service-card small {
  color: var(--muted);
}

.whatsapp-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--paper);
  background: #25d366;
  box-shadow: 0 16px 36px rgba(17,24,39,0.25);
}

.whatsapp-float svg,
.icon-button svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 800;
}

.flash.error { color: var(--red-dark); background: #ffe8ea; }
.flash.success { color: #14532d; background: #dcfce7; }

.result-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(215,25,32,0.1), transparent 32%),
    var(--soft);
}

.result-card {
  width: min(100%, 520px);
  padding: 20px;
}

.result-card dl {
  margin: 18px 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.result-card dt {
  margin-bottom: 8px;
  color: var(--blue);
  font-weight: 900;
}

.result-card dd {
  margin: 0;
  color: var(--muted);
}

.result-actions {
  display: grid;
  gap: 10px;
}

.admin-body {
  background: var(--soft);
}

.admin-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}

.admin-nav {
  order: 3;
  width: 100%;
}

.icon-button {
  width: 42px;
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--paper);
  background: transparent;
}

.admin-shell {
  display: grid;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.admin-panel {
  padding: 16px;
  box-shadow: none;
}

.admin-form {
  display: grid;
  gap: 12px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.inline-form,
.admin-row {
  display: grid;
  gap: 10px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: 20px;
  min-height: 20px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.pill-list form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: #e8eefb;
}

.pill-list button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  color: var(--paper);
  background: var(--red);
}

.booking-table {
  display: grid;
  gap: 10px;
}

.booking-item {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.booking-item strong,
.booking-item span,
.booking-item small {
  display: block;
}

.booking-item small,
.booking-item p,
.admin-note {
  color: var(--muted);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
  padding: 20px;
}

@media (min-width: 700px) {
  .site-header,
  .admin-header {
    padding: 14px 28px;
  }

  .top-actions .icon-link {
    display: inline-flex;
  }

  .site-header .top-actions {
    display: flex;
    position: static;
  }

  .mobile-language-switch {
    display: none;
  }

  .hero {
    min-height: 78vh;
    align-items: center;
  }

  .hero::after {
    background: linear-gradient(90deg, rgba(6,39,95,0.95) 0, rgba(6,39,95,0.78) 38%, rgba(6,39,95,0.12) 100%);
  }

  .hero-copy {
    width: auto;
    padding: 90px 32px;
  }

  h1 {
    font-size: clamp(3.6rem, 7vw, 4.9rem);
  }

  .hero-badges span {
    flex: 0 1 auto;
  }

  .booking-section,
  .services-section {
    width: min(1120px, calc(100% - 44px));
    margin: 0 auto;
    padding: 40px 0;
  }

  .booking-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 22px;
  }

  .booking-form > label:first-child,
  .booking-form > label,
  .booking-form > .field-grid,
  .booking-form > .primary-button {
    grid-column: 1 / -1;
  }

  .booking-calendar {
    grid-column: 1 / 2;
  }

  .time-picker {
    grid-column: 2 / 3;
    align-self: start;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .service-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-header {
    align-items: center;
    flex-wrap: nowrap;
  }

  .admin-nav {
    order: unset;
    width: auto;
  }

  .service-row {
    grid-template-columns: 1.2fr 1.2fr 0.6fr 0.7fr 0.5fr auto;
    align-items: end;
  }

  .inline-form {
    grid-template-columns: 1fr 160px 160px auto;
    align-items: end;
  }

  .booking-item {
    grid-template-columns: 1fr 260px;
    align-items: center;
  }
}
