:root {
  --peach: #ff8a65;
  --peach-dark: #f4633a;
  --teal: #26a69a;
  --teal-dark: #00897b;
  --grape: #7e6bb0;
  --bg: #fff7f2;
  --card: #ffffff;
  --ink: #3a2c26;
  --muted: #8a7a72;
  --line: #f0e2da;
  --ok: #2e7d32;
  --shadow: 0 8px 24px rgba(180, 100, 70, 0.14);
  --shadow-lg: 0 18px 44px rgba(180, 100, 70, 0.2);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Rubik", "Segoe UI", system-ui, -apple-system, "Arial Hebrew", Arial, sans-serif;
  color: var(--ink);
  direction: rtl;
  line-height: 1.5;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 88% 12%, rgba(255, 138, 101, 0.14), transparent 42%),
    radial-gradient(circle at 8% 22%, rgba(126, 107, 176, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(38, 166, 154, 0.1), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 70px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 34px 16px 54px;
  background: linear-gradient(155deg, #ffb199 0%, var(--peach) 45%, var(--peach-dark) 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero.teal {
  background: linear-gradient(155deg, #5fd0c4 0%, var(--teal) 48%, var(--teal-dark) 100%);
}
.hero .badge-emoji {
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 2;
  animation: pop 0.5s ease;
}
.hero h1 { margin: 6px 0 4px; font-size: 27px; font-weight: 900; position: relative; z-index: 2; }
.hero p { margin: 0; opacity: 0.96; font-size: 15px; position: relative; z-index: 2; }

/* floating decorations */
.hero-decor { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.hero-decor span {
  position: absolute;
  font-size: 20px;
  opacity: 0.55;
  animation: float 7s ease-in-out infinite;
}
.hero-decor .d1 { top: 18px; right: 12%; font-size: 24px; animation-delay: 0s; }
.hero-decor .d2 { top: 30px; left: 14%; font-size: 16px; animation-delay: 1.1s; }
.hero-decor .d3 { top: 64px; right: 24%; font-size: 14px; animation-delay: 2s; }
.hero-decor .d4 { top: 52px; left: 26%; font-size: 22px; animation-delay: 0.6s; }
.hero-decor .d5 { top: 96px; left: 8%; font-size: 15px; animation-delay: 1.6s; }
.hero-decor .d6 { top: 100px; right: 8%; font-size: 18px; animation-delay: 2.4s; }

.hero-wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 44px; display: block; z-index: 1; }
.hero-wave path { fill: var(--bg); }

@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-11px) rotate(4deg); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Day groups ---------- */
.day { margin-top: 24px; animation: rise 0.4s ease both; }
.day h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--peach-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.day h3::before { content: "📅"; }

.slot-list { display: flex; flex-direction: column; gap: 12px; }

.slot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.slot::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(var(--peach), var(--peach-dark));
}
.slot:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.slot-emoji { font-size: 26px; line-height: 1; }
.slot-time { font-size: 21px; font-weight: 700; letter-spacing: 0.5px; }
.slot-note { color: var(--muted); font-size: 14px; margin-top: 2px; }
.slot .grow { flex: 1; }

.badge { font-size: 12px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.badge.booked { background: #eceff1; color: #607d8b; }
.badge.open { background: #e3f4ea; color: var(--ok); }

/* ---------- Buttons ---------- */
.btn {
  border: 0;
  background: var(--peach);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(244, 99, 58, 0.28);
  transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--peach-dark); }
.btn:active { transform: scale(0.97); }
.btn.secondary { background: #eee3dc; color: var(--ink); box-shadow: none; }
.btn.teal { background: var(--teal); box-shadow: 0 4px 12px rgba(38, 166, 154, 0.3); }
.btn.teal:hover { background: var(--teal-dark); }
.btn.danger { background: #ef5350; box-shadow: none; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.btn.block { width: 100%; }

/* ---------- Empty / status ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 16px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }
.muted { color: var(--muted); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(40, 25, 18, 0.45);
  display: none; align-items: center; justify-content: center;
  padding: 16px; z-index: 50;
}
.modal-back.show { display: flex; }
.modal {
  background: #fff; border-radius: 24px; padding: 24px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: pop 0.22s ease;
}
.modal h2 { margin: 0 0 4px; font-size: 21px; }
.modal .when { color: var(--peach-dark); font-weight: 600; margin-bottom: 16px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 14px; margin: 12px 0 6px; font-weight: 600; }
input[type="text"], input[type="tel"], input[type="time"] {
  width: 100%; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus { outline: 2px solid var(--peach); border-color: transparent; }
.row { display: flex; gap: 10px; }
.row > div { flex: 1; }
.actions { display: flex; gap: 10px; margin-top: 20px; }

.success { text-align: center; padding: 10px 0; }
.success .check { font-size: 50px; animation: pop 0.4s ease; }

/* ---------- Cards (admin) ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-top: 18px;
  animation: rise 0.4s ease both;
}
.card h2 { margin: 0 0 12px; font-size: 18px; }
.slot-admin {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.slot-admin:first-of-type { border-top: 0; }
.slot-admin .info { flex: 1; min-width: 150px; }
.slot-admin .who { font-size: 13px; color: var(--teal-dark); margin-top: 4px; }
.slot-admin .who a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }

.toast {
  position: fixed; bottom: 20px; right: 50%; transform: translateX(50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: opacity 0.2s; z-index: 80;
}
.toast.show { opacity: 1; }
.error-text { color: #c62828; font-size: 14px; margin-top: 8px; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- Hebrew calendar ---------- */
.date-field { position: relative; }
.date-display {
  width: 100%; text-align: start; padding: 12px 40px 12px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font-size: 16px; font-family: inherit; cursor: pointer; position: relative;
}
.date-display::after { content: "📅"; position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); }
.date-display.placeholder { color: var(--muted); }

.cal {
  position: absolute; z-index: 20; top: calc(100% + 6px); inset-inline-end: 0;
  width: 300px; max-width: 92vw; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  box-shadow: var(--shadow-lg);
}
.cal[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 700; font-size: 15px; }
.cal-nav {
  border: 0; background: #f6ede7; color: var(--ink);
  width: 32px; height: 32px; border-radius: 10px; font-size: 18px; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.cal-nav:hover { background: #efe0d6; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow-cell { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal-empty { height: 36px; }
.cal-day {
  height: 36px; border: 0; background: transparent; border-radius: 10px;
  font-size: 14px; cursor: pointer; font-family: inherit; color: var(--ink);
}
.cal-day:hover:not(:disabled) { background: #f0e2da; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.cal-day.sel { background: var(--teal); color: #fff; }
.cal-day.past { color: #cdbcb2; cursor: default; }

/* ---------- OTP login ---------- */
.otp-input {
  text-align: center; letter-spacing: 10px; font-size: 26px; font-weight: 700;
}
