/* Theme aligned with assets/images/banner.jpeg (saffron, red, brown) */
:root {
  --font-gujarati: 'Anek Gujarati', sans-serif;
  --theme-saffron: #e85d04;
  --theme-saffron-dark: #c2410c;
  --theme-saffron-deep: #9a3412;
  --theme-saffron-light: #fff7ed;
  --theme-saffron-muted: #ffedd5;
  --theme-red: #dc2626;
  --theme-red-dark: #b91c1c;
  --theme-brown: #442f1a;
  --theme-brown-soft: #6b5344;

  --mdc-theme-primary: var(--theme-saffron);
  --mdc-theme-on-primary: #fff;
  --mdc-theme-error: var(--theme-red-dark);
  --mdc-outlined-text-field-container-shape: 4px;
  --mdc-outlined-text-field-focus-outline-width: 2px;
  --page-bg: var(--theme-saffron-light);
  --card-bg: #fff;
  --label-color: var(--theme-brown);
  --hint-color: var(--theme-brown-soft);
  --outline-idle: #e7d5c4;
  --card-shadow: 0 2px 6px rgba(154, 52, 18, 0.08), 0 8px 24px rgba(154, 52, 18, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Roboto, var(--font-gujarati), system-ui, sans-serif;
  background: var(--page-bg);
  color: var(--theme-brown);
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-x: hidden;
}

.page {
  width: 100%;
  max-width: min(440px, 100%);
  margin: 0 auto;
}

.page--success {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 20px 16px 24px;
  overflow: hidden;
  border: 1px solid rgba(232, 93, 4, 0.12);
}

.card-banner {
  margin: -20px -16px 16px;
  background: #fff;
  line-height: 0;
}

.card-banner::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg,
      var(--theme-saffron) 0%,
      var(--theme-red) 50%,
      var(--theme-saffron) 100%);
}

.card-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(130px, 32vw, 200px);
  object-fit: contain;
  object-position: center;
}

.page-title {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
  color: var(--theme-saffron-deep);
  letter-spacing: 0.01em;
}

.page-title .bilingual .en,
.page-title .bilingual .gu {
  font-weight: 800;
}

.subtitle {
  margin: 0 0 20px;
  font-size: clamp(0.8rem, 2.8vw, 0.9rem);
  color: var(--label-color);
  text-align: center;
  line-height: 1.45;
  padding: 0 4px;
}

.subtitle--highlight {
  margin: 0 0 22px;
  padding: 12px 14px;
  font-size: clamp(0.875rem, 3vw, 0.975rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--theme-saffron-deep);
  background: linear-gradient(135deg,
      var(--theme-saffron-muted) 0%,
      #fff 50%,
      var(--theme-saffron-muted) 100%);
  border: 1px solid rgba(232, 93, 4, 0.35);
  border-left: 4px solid var(--theme-saffron);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(154, 52, 18, 0.08);
}

.subtitle--highlight .bilingual .en,
.subtitle--highlight .bilingual .gu {
  color: var(--theme-saffron-deep);
  font-weight: 600;
}

.subtitle--highlight .bilingual--inline .gu::before {
  color: var(--theme-red);
  font-weight: 700;
}

.subtitle--highlight .bilingual .en,
.subtitle--highlight .bilingual .gu {
  font-weight: 600;
}

.field {
  width: 100%;
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(0.8125rem, 2.5vw, 0.875rem);
  font-weight: 500;
  color: var(--label-color);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.field-label--required::after {
  content: ' *';
  color: var(--theme-red);
  font-weight: 700;
}

.field-label--optional {
  font-weight: 500;
  color: var(--label-color);
}

.field-label--optional .bilingual--inline {
  display: inline;
  white-space: nowrap;
}

/* Material text fields */
.booking-form .mdc-text-field {
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  background-color: var(--card-bg);
}

.booking-form .mdc-text-field--outlined {
  --mdc-outlined-text-field-container-height: 56px;
}

.booking-form .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,
.booking-form .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,
.booking-form .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing,
.booking-form .mdc-text-field--focused .mdc-notched-outline__leading,
.booking-form .mdc-text-field--focused .mdc-notched-outline__notch,
.booking-form .mdc-text-field--focused .mdc-notched-outline__trailing {
  border-color: var(--mdc-theme-primary) !important;
}

.booking-form .mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,
.booking-form .mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,
.booking-form .mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing {
  border-color: var(--mdc-theme-error) !important;
}

.booking-form .mdc-floating-label {
  color: var(--hint-color);
  font-family: Roboto, var(--font-gujarati), system-ui, sans-serif;
  font-weight: 700;
}

.booking-form .mdc-floating-label .en,
.booking-form .mdc-floating-label .gu {
  font-weight: 700;
}

.booking-form .mdc-text-field--focused .mdc-floating-label,
.booking-form .mdc-text-field--invalid .mdc-floating-label {
  color: var(--mdc-theme-primary);
}

.booking-form .mdc-text-field--invalid .mdc-floating-label {
  color: var(--mdc-theme-error);
}

.booking-form .mdc-floating-label .bilingual .gu {
  font-family: var(--font-gujarati);
}

.booking-form .mdc-floating-label--required::after {
  color: var(--theme-red);
}

.booking-form .mdc-floating-label--one-line {
  white-space: nowrap;
}

.booking-form .mdc-floating-label--one-line .bilingual--inline {
  white-space: nowrap;
}

#field-note .mdc-notched-outline__notch {
  max-width: none;
}

.booking-form .mdc-text-field__input {
  font-size: 16px;
  color: var(--theme-brown);
  caret-color: var(--mdc-theme-primary);
}

.booking-form .mdc-text-field-helper-line {
  margin-bottom: 4px;
  padding: 0 16px;
}

.booking-form .mdc-text-field-helper-text {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--hint-color);
}

.booking-form .mdc-text-field-helper-text--validation {
  color: var(--mdc-theme-error);
}

.booking-form .mdc-text-field--invalid .mdc-text-field-helper-text--validation {
  opacity: 1;
}

.booking-form .mdc-text-field-helper-text--validation[aria-hidden='true'] {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.booking-form .mdc-text-field-helper-text--validation[aria-hidden='false'] {
  opacity: 1;
  height: auto;
  margin-top: 3px;
}

/* Chair field — stepper + Material text field */
.chair-field-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.field--chairs .mdc-text-field {
  min-width: 0;
}

.field--chairs .chair-stepper__input {
  text-align: center;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}

.field--chairs .chair-stepper__input::-webkit-outer-spin-button,
.field--chairs .chair-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chair-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--outline-idle);
  border-radius: 50%;
  background: #fff;
  color: var(--mdc-theme-primary);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.chair-stepper__btn:hover:not(:disabled) {
  border-color: var(--mdc-theme-primary);
  background: var(--theme-saffron-muted);
  box-shadow: 0 1px 3px rgba(154, 52, 18, 0.12);
}

.chair-stepper__btn:active:not(:disabled) {
  background: var(--theme-saffron-muted);
  transform: scale(0.96);
}

.chair-stepper__btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.submit-btn.mdc-button--raised {
  background-color: var(--mdc-theme-primary);
  border-radius: 12px;
}

.submit-btn.mdc-button--raised:not(:disabled):hover {
  background-color: var(--theme-saffron-dark);
}

.submit-btn.mdc-button--raised:not(:disabled):active {
  background-color: var(--theme-saffron-deep);
}

.submit-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 52px;
  font-size: clamp(0.9375rem, 2.8vw, 1rem);
  letter-spacing: 0.02em;
}

.card--centered {
  text-align: center;
}

.page-title--success {
  font-size: clamp(1.15rem, 4vw, 1.5rem);
}

.page--success .subtitle--highlight .bilingual--stacked .gu {
  font-size: calc(0.92em + 1px);
}

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

.success-note {
  margin: 4px 0 0;
  padding: 11px 13px;
  text-align: center;
  background: rgba(220, 38, 38, 0.05);
  border: 1px dashed rgba(185, 28, 28, 0.4);
  border-radius: 10px;
}

.success-note__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--theme-red);
  border-radius: 50%;
}

.success-note__text {
  display: inline;
  margin: 0;
  font-family: var(--font-gujarati);
  font-size: clamp(0.8125rem, 2.6vw, 0.9rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--theme-red-dark);
}

/* Success — booking history (aligned compact grid) */
.card--history {
  padding: 14px 14px 16px;
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, var(--theme-saffron-light) 120%);
}

.history-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(232, 93, 4, 0.12);
}

.history-header__line {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-header__sep {
  color: var(--theme-saffron);
  font-weight: 700;
}

.history-title {
  color: var(--theme-saffron-deep);
  font-weight: 800;
}

.history-title__count {
  font-weight: 600;
  color: var(--hint-color);
}

.history-meta {
  font-weight: 500;
  color: var(--theme-brown);
}

.history-meta__label {
  font-weight: 600;
  color: var(--theme-saffron-deep);
}

.history-grid {
  --history-cols: 2.8rem 5rem minmax(4rem, 1fr) 2.25rem minmax(0, 1fr);
}

.history-grid__head,
.history-grid__row {
  display: grid;
  grid-template-columns: var(--history-cols);
  gap: 6px 8px;
  align-items: center;
}

.history-grid__head {
  padding: 0 8px 6px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hint-color);
}

.history-grid__head span:last-child,
.history-grid__note {
  text-align: left;
}

.history-grid__head span:nth-child(4),
.history-grid__chairs {
  text-align: center;
}

.history-grid__id {
  font-family: monospace, var(--font-roboto);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--theme-saffron, #e85d04);
}

.booking-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(232, 93, 4, 0.08);
  border: 1px solid rgba(232, 93, 4, 0.25);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--theme-saffron, #e85d04);
}

.booking-id-badge__num {
  font-family: monospace, var(--font-roboto);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(48vh, 300px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(232, 93, 4, 0.1);
}

.history-grid__row {
  padding: 9px 8px;
  font-size: 0.75rem;
  line-height: 1.25;
  color: var(--theme-brown);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.history-grid__row:last-child {
  border-bottom: none;
}

.history-grid__row:nth-child(even) {
  background: rgba(255, 247, 237, 0.65);
}

.history-grid__row--latest {
  background: var(--theme-saffron-muted);
  box-shadow: inset 3px 0 0 var(--theme-saffron);
}

.history-grid__date {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--hint-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-grid__name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-grid__chairs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--theme-saffron);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.history-grid__note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hint-color);
  font-size: 0.6875rem;
}

.history-empty {
  margin: 0;
  padding: 14px 10px;
  font-size: 0.8125rem;
  color: var(--hint-color);
  text-align: center;
  background: #fff;
  border-radius: 10px;
}

.history-empty-action {
  margin-top: 14px;
}

@media (max-width: 360px) {
  .history-grid {
    --history-cols: 2.4rem 4.2rem minmax(3.2rem, 1fr) 1.8rem minmax(0, 1fr);
  }

  .history-grid__head,
  .history-grid__row {
    gap: 4px 6px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

/* Tablet / larger phones */
@media (min-width: 480px) {
  body {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  .card {
    padding: 28px 24px 32px;
    border-radius: 18px;
  }

  .card-banner {
    margin: -28px -24px 20px;
  }

  .card-banner img {
    max-height: clamp(160px, 28vw, 240px);
  }

  .subtitle {
    margin-bottom: 24px;
  }

  .field {
    margin-bottom: 20px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  body {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  .card {
    padding: 16px 12px 20px;
    border-radius: 12px;
  }

  .card-banner {
    margin: -16px -12px 14px;
  }

  .card-banner img {
    max-height: clamp(110px, 36vw, 150px);
  }

  .bilingual--inline {
    line-height: 1.4;
  }
}