/** @format */

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --success: #22c55e;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #8b949e;
    --line: #30363d;
    --accent: #58a6ff;
    --accent-hover: #388bfd;
    --accent-soft: rgba(31, 111, 235, 0.15);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg:
      0 10px 15px -3px rgb(0 0 0 / 0.45), 0 4px 6px -4px rgb(0 0 0 / 0.35);
  }
}

[data-theme="dark"] {
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --line: #30363d;
  --accent: #58a6ff;
  --accent-hover: #388bfd;
  --accent-soft: rgba(31, 111, 235, 0.15);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.45), 0 4px 6px -4px rgb(0 0 0 / 0.35);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, hsla(221, 83%, 93%, 1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(221, 83%, 96%, 1) 0, transparent 50%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(at 0% 0%, hsla(221, 70%, 22%, 0.7) 0, transparent 55%),
    radial-gradient(at 55% 0%, hsla(230, 60%, 18%, 0.55) 0, transparent 50%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background-image:
      radial-gradient(at 0% 0%, hsla(221, 70%, 22%, 0.7) 0, transparent 55%),
      radial-gradient(at 55% 0%, hsla(230, 60%, 18%, 0.55) 0, transparent 50%);
  }
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(at 0% 0%, hsla(220, 40%, 10%, 0.8) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(215, 45%, 8%, 0.9) 0, transparent 50%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background-image:
      radial-gradient(at 0% 0%, hsla(220, 40%, 10%, 0.8) 0, transparent 50%),
      radial-gradient(at 50% 0%, hsla(215, 45%, 8%, 0.9) 0, transparent 50%);
  }
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
}

.header p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Step Indicator */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  padding: 0 10px;
}

.steps::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.step {
  position: relative;
  z-index: 1;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--muted);
  transition: all 0.3s ease;
}

.step.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.step.completed {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Card Styling */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.6) inset,
    0 -1px 0 0 rgba(0, 0, 0, 0.06) inset,
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 12px 28px -4px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--line);
  margin-bottom: 24px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

[data-theme="dark"] .card {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 12px 28px -4px rgba(0, 0, 0, 0.5),
    0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
      0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
      0 4px 6px -1px rgba(0, 0, 0, 0.4),
      0 12px 28px -4px rgba(0, 0, 0, 0.5),
      0 2px 4px -1px rgba(0, 0, 0, 0.3);
  }
}

.card h2 {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden {
  display: none !important;
}

/* Service List */
.service-list {
  display: grid;
  gap: 12px;
}

.service-btn {
  text-align: left;
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.service-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}

.service-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.service-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
  font-weight: 500;
}

/* Inputs & Forms */
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--card);
  color: var(--text);
}

/* Date Input Wrapper */
.date-input-wrapper {
  position: relative;
  display: flex;
  width: fit-content;
  min-width: 180px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin: 0 auto;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  min-height: 52px;
}

.date-display {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  pointer-events: none;
}

.date-input-wrapper::after {
  content: "📅";
  pointer-events: none;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.input[type="date"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
}

.input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Slot Empty/Error States */
.empty-slots-state {
  background: var(--bg);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  margin-top: 16px;
}

.empty-slots-state p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.working-hours-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.field-group {
  margin-bottom: 24px;
}

/* Slots Grid */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.slot-btn {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 12px 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-align: center;
  color: var(--text);
  -webkit-text-fill-color: currentColor;
  /* iOS Safari: default button styles can hide or override label text */
  -webkit-appearance: none;
  appearance: none;
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.slot-btn.active:hover:not(:disabled) {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.slot-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

/* Buttons */
.btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  margin-top: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 8px;
}

.btn-link:hover {
  color: var(--text);
  background: var(--bg);
}

.btn-link::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.btn-link:hover::before {
  transform: rotate(45deg) translateX(-2px) translateY(2px);
}

.booking-footer {
  text-align: center;
  padding: 24px 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.booking-footer a {
  color: var(--muted);
  text-decoration: underline;
}

.booking-footer-ig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  margin-bottom: 8px;
}

.booking-consent-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

.booking-consent-note a {
  color: var(--muted);
  text-decoration: underline;
}

/* Slots Loader */
.slots-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--muted);
  font-weight: 500;
  gap: 12px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error contact sub-message */
.booking-error-contact {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Success State */
.state-success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.4s ease-out forwards;
}

@media (max-width: 480px) {
  .container {
    padding: 20px 16px;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .slots {
    grid-template-columns: repeat(3, 1fr);
  }
}
