:root {
  --brand: rgb(74, 20, 75);
  --brand-dark: rgb(52, 12, 53);
  --brand-light: rgb(104, 42, 105);
  --accent: rgb(224, 185, 77);
  --accent-dark: rgb(200, 160, 50);
  --radius: 12px;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-body);

  /* Theme colours (light) */
  color-scheme: light;
  --bg: #faf8fb;
  --surface: #ffffff;
  --surface-2: #f3eff5;
  --surface-2-hover: #ebe5ee;
  --surface-3: #fbf9fc;
  --hover-row: #fcfaff;
  --text: #241626;
  --muted: #6e6272;
  --placeholder: #a99fad;
  --border: #e4dde7;
  --border-strong: #cfc4d3;
  --grid: #eee8f1;
  --grid-base: #d9cfdd;
  --brand-text: var(--brand);     /* purple used for text, links and focus rings */
  --primary: var(--brand);        /* purple used for button and badge backgrounds */
  --primary-hover: var(--brand-dark);
  --ring: rgba(74, 20, 75, 0.12);
  --tint-bg: #ece6f0;
  --tint-bg-soft: #f7f0f7;
  --tint-bd: #d9c3da;
  --ok-bg: #e8f5ee;  --ok-fg: #2e7d4f;  --ok-bd: #bfe0cc;
  --warn-bg: #fff4d6; --warn-fg: #8a6a00; --warn-bd: #f0dc9c;
  --err-bg: #fdecea; --err-fg: #c0392b; --err-bd: #f5c6c0;
  --danger: #c0392b;
  --danger-solid: #c0392b;
  --success: #2e7d4f;
  --chart: rgb(74, 20, 75);
  --hover-band: rgba(74, 20, 75, 0.07);
  --cross: rgba(74, 20, 75, 0.35);
}

/* Dark theme: chosen by js/theme.js from the device setting or the toggle in the top bar */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #130d15;
  --surface: #1c141f;
  --surface-2: #2a2030;
  --surface-2-hover: #342839;
  --surface-3: #221a26;
  --hover-row: #261c2a;
  --text: #f2ebf4;
  --muted: #ab9db2;
  --placeholder: #7f7186;
  --border: #392c3e;
  --border-strong: #54435b;
  --grid: #2c2230;
  --grid-base: #43344a;
  --brand-text: #dca9de;
  --primary: #6e2670;
  --primary-hover: #84308a;
  --ring: rgba(220, 169, 222, 0.25);
  --tint-bg: #2d2133;
  --tint-bg-soft: #261b2c;
  --tint-bd: #5a3f61;
  --ok-bg: #16301f;  --ok-fg: #6fd49a;  --ok-bd: #25533a;
  --warn-bg: #3a3014; --warn-fg: #f0cd6a; --warn-bd: #5f4d1c;
  --err-bg: #3b1a1a; --err-fg: #ff9a8a; --err-bd: #6a2c2a;
  --danger: #ff9a8a;
  --success: #6fd49a;
  --chart: rgb(224, 185, 77);
  --hover-band: rgba(224, 185, 77, 0.09);
  --cross: rgba(224, 185, 77, 0.45);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ---------- Layout: split screen on desktop, stacked on mobile ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth__brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, var(--brand-light) 0%, transparent 55%),
    var(--brand);
}

.auth__brand::before,
.auth__brand::after {
  content: "";
  position: absolute;
  left: -10%;
  width: 120%;
  height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgba(224, 185, 77, 0.28);
  pointer-events: none;
}
.auth__brand::before { bottom: -110px; }
.auth__brand::after { bottom: -150px; border-color: rgba(224, 185, 77, 0.15); }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}
.logo__img {
  display: block;
  height: 72px;
  width: auto;
}

.auth__pitch { position: relative; z-index: 1; max-width: 26rem; }
.auth__pitch h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}
.auth__pitch h2 em { font-style: normal; color: var(--accent); }
.auth__pitch p { margin: 0; color: rgba(255, 255, 255, 0.78); }
.auth__foot { position: relative; z-index: 1; font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); }

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.card { width: 100%; max-width: 26rem; }

.card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 0.35rem;
  color: var(--brand-text);
}
.card__sub { margin: 0 0 2rem; color: var(--muted); }

/* ---------- Form ---------- */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.input-wrap { position: relative; display: flex; }
.input-wrap .prefix {
  display: grid;
  place-items: center;
  padding: 0 0.85rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.input-wrap .prefix + input { border-radius: 0 var(--radius) var(--radius) 0; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 1rem; /* 16px+ prevents iOS zoom on focus */
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--placeholder); }
input:hover { border-color: var(--border-strong); }
input:focus {
  outline: none;
  border-color: var(--brand-text);
  box-shadow: 0 0 0 4px var(--ring);
}
.field.has-error input { border-color: var(--danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.14); }
.field__error { display: none; margin-top: 0.35rem; font-size: 0.8rem; color: var(--danger); }
.field.has-error .field__error { display: block; }

.toggle-pw {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-text);
  cursor: pointer;
  border-radius: 8px;
}
.toggle-pw:hover { background: rgba(74, 20, 75, 0.07); }
.input-wrap--pw input { padding-right: 4.5rem; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.2rem 0 1.5rem;
  font-size: 0.875rem;
}
.check { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--muted); }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }

a { color: var(--brand-text); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.btn {
  width: 100%;
  height: 3.1rem;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 6px 16px -6px rgba(74, 20, 75, 0.55);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; }
.btn[disabled] { opacity: 0.7; cursor: progress; }

.alert {
  display: none;
  margin-bottom: 1.25rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.alert.show { display: block; }
.alert--notice { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--warn-bd); }
.alert--error { background: var(--err-bg); color: var(--danger); border: 1px solid var(--err-bd); }
.alert--success { background: var(--ok-bg); color: var(--success); border: 1px solid var(--ok-bd); }

.switch { margin: 1.75rem 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }

.note { margin: 1.25rem 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .auth__brand {
    padding: 1rem 1.5rem 1.75rem;
    border-radius: 0 0 28px 28px;
  }
  .auth__pitch, .auth__foot { display: none; }
  .logo__img { height: 56px; }
  .auth__brand::before { bottom: -150px; }
  .auth__brand::after { display: none; }

  .auth__panel { align-items: flex-start; padding: 2rem 1.25rem 2.5rem; }
  .card h1 { font-size: 1.75rem; }
  .card__sub { margin-bottom: 1.5rem; }
}

@media (max-width: 380px) {
  .row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- International phone field ---------- */
.input-wrap .phone-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  height: 3rem;
  padding: 0 0.7rem 0 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}
.input-wrap .phone-trigger:hover { background: var(--surface-2-hover); }
.input-wrap .phone-trigger:focus-visible { outline: none; }
.phone-trigger .flag, .phone-pop .flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
.phone-trigger__dial { color: var(--text); font-weight: 600; }
.phone-trigger__chev { color: var(--muted); }
.phone-field input[type="tel"] { min-width: 0; }

.phone-pop {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(52, 12, 53, 0.35);
  overflow: hidden;
}
.phone-pop[hidden] { display: none; }
.phone-pop__search {
  flex: none;
  width: 100%;
  height: 2.8rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
  border-radius: 0;
}
.phone-pop__search:focus { outline: none; background: var(--surface); }
.phone-pop__list { margin: 0; padding: 0.3rem; list-style: none; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.phone-pop__list li { display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem 0.65rem; border-radius: 8px; font-size: 0.92rem; cursor: pointer; }
.phone-pop__list li.is-active { background: var(--surface-2); }
.phone-pop__list li[aria-selected="true"] .phone-pop__name { color: var(--brand-text); font-weight: 700; }
.phone-pop__list li.has-divider { margin-top: 0.3rem; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; padding-top: 0.85rem; }
.phone-pop__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-pop__dial { color: var(--muted); font-variant-numeric: tabular-nums; }
.phone-pop__list li.phone-pop__empty { color: var(--muted); cursor: default; justify-content: center; }

/* ---------- Primary button: soft lift, glow and a gold sweep on hover ----------
   Used by every .btn (sign in, register, save, create…) and the New Reservation button. */
.btn,
.act--cta {
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px -6px rgba(74, 20, 75, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.act--cta { padding: 0 1.6rem; }
.btn::after,
.act--cta::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -70%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(224, 185, 77, 0.55), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
@keyframes cta-sweep { to { left: 140%; } }
@media (hover: hover) {
  .btn:not([disabled]):hover,
  .act--cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(74, 20, 75, 0.65);
  }
  .btn:not([disabled]):hover::after,
  .act--cta:hover::after { animation: cta-sweep 0.8s ease 1; }
}
.btn:not([disabled]):active,
.act--cta:active { transform: translateY(0) scale(0.98); box-shadow: 0 4px 10px -4px rgba(74, 20, 75, 0.6); }
@media (prefers-reduced-motion: reduce) {
  .btn::after, .act--cta::after { animation: none; display: none; }
}

/* ---------- Forgot password: "check your email" state ---------- */
.sent { text-align: center; }
.sent[hidden] { display: none; }
.sent__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--tint-bg);
  color: var(--brand-text);
}
.sent .card__sub { margin-bottom: 1.25rem; }
.link-btn {
  border: 0;
  background: none;
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand-text);
  cursor: pointer;
  border-radius: 8px;
}
.link-btn:hover:not([disabled]) { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.link-btn[disabled] { color: var(--muted); cursor: default; font-weight: 600; }
