:root {
  --bg: #0e1116;
  --card: #13161c;
  --surface: #171b22; /* day / slot / input cells */
  --muted-bg: #14171d; /* full / closed cells */
  --ink: #e8ecf4;
  --muted: #8a93a6;
  --line: #262b35;
  --accent: #22d3ee;
  --accent-ink: #04131a;
  --accent-soft: #0f1f24;
  --danger: #f87171;
  --radius: 12px;
  --shadow: 0 28px 64px -26px rgba(0, 0, 0, 0.75);
  --glow: 0 0 20px -2px rgba(34, 211, 238, 0.75);
  --glow-soft: 0 0 12px -2px rgba(34, 211, 238, 0.4);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
  display: flex;
  justify-content: center;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.tz-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

section {
  margin-top: 1.5rem;
}

/* Extended-hours consent */
#consent {
  margin-bottom: 1rem;
}

.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}

.consent:hover {
  border-color: var(--accent);
}

.consent input[type="checkbox"] {
  width: auto;
  margin: 0.15rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Calendar */
.calendar {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.month-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-bottom: 0.2rem;
}

.cell {
  aspect-ratio: 1 / 1;
}

.cell--empty {
  border: 0;
  background: transparent;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

button.day.is-open {
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease,
    box-shadow 0.12s ease;
}

button.day.is-open:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--glow-soft);
}

.day.is-disabled {
  border-color: transparent;
  background: var(--muted-bg);
  color: #525b6a;
}

.day.is-out {
  background: transparent;
  color: #39414d;
}

button.day.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent), var(--glow);
}

.day-num {
  line-height: 1;
  font-size: 0.95rem;
  font-family: var(--mono);
}

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}

button.day.has-openings .day-dot {
  background: var(--accent);
  box-shadow: 0 0 7px 1px rgba(34, 211, 238, 0.9);
}

button.day.is-full {
  color: var(--muted);
}

button.day.is-full .day-dot {
  background: var(--line);
}

button.day.is-selected .day-dot {
  background: var(--accent-ink);
  box-shadow: none;
}

.slots-heading {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

/* Same thin dashed separator + spacing between every group, standard or opt-in. */
.slot-group + .slot-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

/* Opt-in (US/Asia) windows: tinted band with an accent edge so they stand out,
   while keeping the same dashed separator as the standard bands. */
.slot-group--ext {
  padding: 0.85rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 2rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.empty-state svg {
  width: 38px;
  height: 38px;
  color: var(--accent);
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
}

.empty-title {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.empty-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.slot {
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-family: var(--mono);
  cursor: pointer;
}

.slot:hover {
  border-color: var(--accent);
}

.slot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 0 18px -2px rgba(34, 211, 238, 0.65);
}

.muted {
  color: var(--muted);
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.form-heading {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field > span {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.field em {
  font-weight: 400;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}

input::placeholder,
textarea::placeholder {
  color: #5a6473;
}

textarea {
  resize: vertical;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

button.primary,
button.ghost {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 22px -4px rgba(34, 211, 238, 0.7);
}

button.primary:hover {
  filter: brightness(1.08);
}

button.primary:disabled {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

button.ghost:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.error {
  color: var(--danger);
  margin: 0.75rem 0 0;
}

.confirmation {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.confirmation h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.conf-when {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.conf-provider,
.conf-detail {
  margin: 0.25rem 0;
  color: var(--muted);
}

.join-link {
  display: inline-block;
  margin: 0.75rem 0;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 0 22px -4px rgba(34, 211, 238, 0.7);
}

.join-link:hover {
  filter: brightness(1.08);
}

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

@media (max-width: 480px) {
  body {
    padding: 1rem 0.5rem;
  }
  .card {
    padding: 1.25rem;
  }
  .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .calendar {
    gap: 1.25rem;
  }
  .month-grid {
    gap: 0.3rem;
  }
  .day-num {
    font-size: 0.82rem;
  }
  .slot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
