:root {
  color-scheme: light;
  --ink: #1f2328;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #dff7f3;
  --warn: #b42318;
  --reserved: #e7eaef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0) 38%),
    var(--soft);
  color: var(--ink);
}

button,
input,
a {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 210px;
  padding: 12px 0 28px;
}

.compact-hero {
  min-height: 150px;
}

.eyebrow,
.step {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.3rem, 7vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.12);
}

.booking-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 0.95fr;
  gap: 16px;
  align-items: start;
}

.flow-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

.flow-layout.single-column {
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
}

.panel,
.reservations-panel,
.flow-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(31, 35, 40, 0.08);
}

.panel {
  padding: 20px;
}

.reservations-panel {
  margin-top: 16px;
  padding: 20px;
}

.flow-panel {
  padding: 20px;
}

.test-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.test-panel .panel-heading,
.test-panel h2,
.test-panel .step {
  margin-bottom: 0;
}

.panel-heading {
  margin-bottom: 18px;
}

.service-list,
.slot-list,
.reservations {
  display: grid;
  gap: 10px;
}

.service-list-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-list-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-picker {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1fr);
  gap: 16px;
}

.slot-picker h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.service-card,
.date-button,
.slot-button,
.reservation-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.service-card,
.date-button,
.slot-button {
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.service-card {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: inherit;
  text-decoration: none;
}

.service-card-with-image {
  grid-template-columns: auto minmax(0, 1fr);
}

.service-card:hover,
.date-button:hover,
.slot-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.service-card[aria-current="true"],
.date-button[aria-pressed="true"],
.slot-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.service-content {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.service-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.service-name,
.slot-day {
  font-weight: 800;
}

.service-price {
  white-space: nowrap;
  color: var(--accent-strong);
  font-weight: 800;
}

.service-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  text-align: right;
  gap: 2px;
  flex: 0 0 auto;
}

.service-image-wrap {
  width: 72px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.service-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.service-description,
.service-duration,
.slot-hour,
.reservation-meta {
  color: var(--muted);
  line-height: 1.45;
}

.slot-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 14px;
}

.slot-picker .slot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.slot-picker .slot-button {
  width: auto;
  min-width: 118px;
  min-height: 50px;
  gap: 12px;
}

.date-button {
  display: grid;
  gap: 4px;
  width: auto;
  min-width: 150px;
  min-height: 62px;
  padding: 12px 14px;
}

.date-button span:first-child {
  font-weight: 800;
}

.date-button span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.slot-button:disabled {
  cursor: not-allowed;
  border-color: var(--reserved);
  background: #f0f2f5;
  color: #8a94a6;
  transform: none;
}

.slot-state {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.slot-button:disabled .slot-state {
  color: #8a94a6;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.summary {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: #394150;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
}

input:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

#submit-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: fit-content;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 0 16px;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--accent-strong);
}

.back-button,
.secondary-button,
.danger-button {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.back-button {
  width: fit-content;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

.back-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent-strong);
  padding: 0 14px;
}

.onsite-button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  padding: 0 14px;
  font-size: 1rem;
  line-height: 1.1;
  background: transparent;
}

.secondary-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.danger-button {
  align-self: center;
  border: 1px solid #f3b8b2;
  background: #fff6f5;
  color: var(--warn);
  padding: 0 14px;
}

.danger-button:hover:not(:disabled) {
  background: #ffe7e3;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

#submit-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

#submit-button:disabled {
  cursor: not-allowed;
  background: #a4b3bf;
}

.message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.message.error {
  color: var(--warn);
}

.message.success {
  color: var(--accent-strong);
}

.reservation-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.reservation-service {
  font-weight: 800;
}

.success-panel {
  display: grid;
  gap: 12px;
}

.intro-small {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.split-heading,
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-panel .message {
  margin-bottom: 12px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 980px) {
  .hero {
    align-items: start;
    flex-direction: column;
  }

  .booking-grid {
    grid-template-columns: 1fr;
  }

  .flow-layout,
  .service-list-wide,
  .slot-list-wide,
  .slot-picker {
    grid-template-columns: 1fr;
  }

  .status-card {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .hero {
    min-height: 0;
    padding-bottom: 18px;
  }

  .panel,
  .reservations-panel {
    padding: 16px;
  }

  .test-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .reservation-row,
  .split-heading,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
  }
}
