:root {
  color-scheme: light;
  --page: #eceeff;
  --app: #ffffff;
  --card: #ffffff;
  --ink: #111318;
  --muted: #6f7480;
  --soft: #a3a9b5;
  --line: #e4e7ef;
  --blue: #0a66ff;
  --green: #0f766e;
  --green-soft: #e7f8f4;
  --hemat: #b666d1;
  --warning: #ff8a00;
  --float-bg: rgba(255, 255, 255, 0.94);
  --float-ink: #111318;
  --float-muted: #6f7480;
  --float-line: rgba(17, 19, 24, 0.12);
  --float-shadow: 0 18px 46px rgba(17, 24, 39, 0.12);
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.12);
  --app-width: 390px;
  --app-gutter: 28px;
  --app-outer-gap: 14px;
}

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

html {
  min-height: 100%;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  padding: var(--app-outer-gap) 0;
  background: var(--page);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

a {
  text-decoration: none;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  position: relative;
  width: min(var(--app-width), calc(100vw - var(--app-gutter)));
  min-height: calc(100dvh - (var(--app-outer-gap) * 2));
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(30px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% -24%, rgba(182, 102, 209, 0.08), transparent 30%),
    var(--app);
  box-shadow: var(--shadow);
  overflow-x: hidden;
}

.app-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  min-height: 46px;
  gap: 0;
}

.app-header img {
  width: 112px;
  height: auto;
  justify-self: center;
}

.app-header .icon-button {
  display: none !important;
}

#stepLabel {
  display: none;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.progress {
  height: 3px;
  margin: 10px 0 20px;
  background: rgba(148, 163, 184, 0.24);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 33.333%;
  height: 100%;
  background: var(--blue);
  transition: width 240ms ease;
}

.step-screen {
  animation: screenIn 180ms ease both;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.055em;
  font-weight: 650;
}

h2 {
  margin: 0 44px 8px 0;
  font-size: 25px;
  line-height: 1.06;
  letter-spacing: -0.045em;
  font-weight: 520;
}

.lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.step-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.icon-refresh {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: 2px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.icon-refresh:hover {
  background: rgba(148, 163, 184, 0.12);
}

.search-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

.search-field span {
  display: grid;
  place-items: center;
  height: 100%;
  border-right: 1px solid var(--line);
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.phone-field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

.phone-country {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--line);
}

.phone-country-prefix {
  color: var(--soft);
  font-size: 14px;
  font-weight: 800;
}

.phone-country input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  outline: 0;
}

.phone-country input::-webkit-outer-spin-button,
.phone-country input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  font-size: 16px;
}

input:focus {
  box-shadow: inset 0 -2px 0 var(--blue);
}

.branch-list,
.date-list,
.slot-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.choice-card,
.slot-card,
.text-button,
.primary-button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

.choice-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 6px;
  min-height: 74px;
  padding: 14px;
  text-align: left;
}

.choice-card::after {
  content: "›";
  position: absolute;
  right: 14px;
  top: 50%;
  color: var(--soft);
  font-size: 28px;
  transform: translateY(-50%);
}

.choice-card span {
  padding-right: 24px;
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.choice-card small {
  padding-right: 24px;
  color: var(--muted);
  font-size: 13px;
}

.choice-card.active {
  border-color: rgba(15, 118, 110, 0.46);
  background: var(--green-soft);
}

.date-choice span {
  font-size: 20px;
}

.date-choice.direct-walkin {
  border-color: rgba(15, 118, 110, 0.32);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), var(--card));
}

.date-choice.direct-walkin small {
  color: var(--blue);
  font-weight: 800;
}

.text-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.promo-pop {
  margin: -4px 0 12px;
  padding: 12px;
  background: rgba(182, 102, 209, 0.12);
  border: 1px solid rgba(182, 102, 209, 0.38);
  color: var(--hemat);
  font-weight: 800;
  text-align: center;
  animation: popIn 220ms ease both;
}

.slot-list {
  grid-template-columns: 1fr;
}

.slot-section-title {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 0 -2px;
  color: var(--hemat);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.slot-section-title.secondary {
  margin-top: 10px;
  color: var(--muted);
}

.slot-card {
  position: relative;
  width: 100%;
  min-height: 94px;
  padding: 14px;
  text-align: left;
  overflow: hidden;
}

.slot-time {
  display: block;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.07em;
  font-weight: 560;
}

.slot-meta {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.32;
}

.slot-card.discount {
  min-height: 112px;
  border-color: rgba(182, 102, 209, 0.56);
  background:
    radial-gradient(circle at 86% 0%, rgba(182, 102, 209, 0.2), transparent 40%),
    var(--card);
}

.slot-card.discount .slot-meta {
  color: var(--hemat);
}

.slot-terms {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.28;
}

.slot-promo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--hemat);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  animation: pulse 1.3s ease-in-out infinite;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 146px;
  padding: 20px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.empty-state strong {
  color: var(--ink);
  font-weight: 560;
}

.primary-button,
.secondary-button {
  position: relative;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  font-weight: 800;
}

.primary-button {
  background: #ffffff;
  border: 1px solid #d8dee9;
  color: #0a66ff;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid #d8dee9;
  color: #0a66ff;
}

.primary-button:hover,
.secondary-button:hover {
  background: #f6f8fb;
}

.button-loading {
  opacity: 0.82;
}

button.button-loading:disabled {
  opacity: 0.82;
}

.button-loading::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 9px;
  border: 2px solid rgba(10, 102, 255, 0.2);
  border-top-color: #0a66ff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.75s linear infinite;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: center;
  justify-items: center;
  box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.modal-panel {
  position: relative;
  width: min(430px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
  animation: popIn 160ms ease both;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.selected-slot-text {
  margin: 0 46px 14px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.phone-field {
  margin-bottom: 0;
}

.phone-step {
  display: block;
}

.otp-sent-box,
.reschedule-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(182, 102, 209, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(182, 102, 209, 0.14), transparent 38%),
    var(--card);
}

.otp-sent-box {
  border-color: var(--line);
  background: var(--card);
}

.otp-sent-box h3,
.reschedule-box h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.otp-sent-number,
.reschedule-name,
.reschedule-info,
.reschedule-question {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.otp-sent-number {
  color: var(--ink);
  font-weight: 800;
}

.reschedule-info {
  margin-top: 8px;
  color: var(--ink);
}

.reschedule-question {
  margin-top: 12px;
  font-weight: 800;
}

.otp-actions,
.reschedule-actions {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 10px;
}

.otp-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.otp-box label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.otp-box input {
  border: 1px solid var(--line);
  background: var(--card);
  text-align: center;
  letter-spacing: 0.22em;
}

.success-share {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--card);
}

.success-share p {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 740;
  line-height: 1.35;
  letter-spacing: -0.03em;
}

.share-actions {
  display: grid;
  gap: 10px;
}

.share-actions .primary-button,
.share-actions .secondary-button {
  margin-top: 0;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60;
  width: min(402px, calc(100% - 28px));
  margin: 0 auto;
  padding: 13px 14px;
  background: var(--ink);
  color: var(--app);
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(251, 251, 253, 0.9);
  backdrop-filter: blur(14px);
}

.loader-card {
  display: grid;
  place-items: center;
  gap: 14px;
  width: min(330px, calc(100vw - 48px));
  min-width: 0;
  min-height: 150px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.loader-logo {
  width: 94px;
  height: auto;
  margin-bottom: 2px;
}

.loader-card strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.loader-card p {
  max-width: 260px;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(10, 102, 255, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.hidden {
  display: none !important;
}

.selection-bar {
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 20;
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
  padding: 12px 12px 13px;
  border: 1px solid var(--float-line);
  background:
    linear-gradient(135deg, rgba(182, 102, 209, 0.09), transparent 46%),
    linear-gradient(180deg, rgba(10, 102, 255, 0.045), transparent 72%),
    var(--float-bg);
  color: var(--float-ink);
  box-shadow: var(--float-shadow);
  backdrop-filter: blur(18px);
}

.summary-back {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--float-line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--float-ink);
  font-size: 30px;
  line-height: 1;
}

.summary-back:hover {
  background: rgba(148, 163, 184, 0.16);
}

.summary-body {
  min-width: 0;
}

.selection-bar span {
  display: block;
  color: var(--float-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.selection-bar strong {
  display: block;
  margin-top: 4px;
  color: var(--float-ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 8px;
}

.summary-grid p {
  margin: 0;
  color: var(--float-muted);
  font-size: 13px;
  font-weight: 650;
}

.selection-bar em {
  display: block;
  margin-top: 10px;
  padding: 9px 10px;
  background: rgba(182, 102, 209, 0.11);
  border: 1px solid rgba(182, 102, 209, 0.34);
  color: var(--hemat);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

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

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

@keyframes sheetIn {
  from {
    transform: translateY(22px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (min-width: 520px) {
  :root {
    --app-width: 390px;
    --app-gutter: calc(100vw - 390px);
    --app-outer-gap: 18px;
  }
}

@media (max-width: 360px) {
  :root {
    --app-gutter: 16px;
  }

  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 {
    font-size: 31px;
  }
}
