/* Order form. Colours and radii come from the theme tokens (eat-theme/assets/css/theme.css); the fallbacks keep the
   form readable under any other theme. Logical properties (inline-start/end) so the Hebrew pages flip by themselves. */

.eat-form {
  display: grid;
  gap: 1.5rem;
  max-inline-size: 40rem;
}

.eat-field {
  display: grid;
  align-content: start;   /* in a two-column row the shorter field keeps its input next to its label */
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.eat-field__label {
  font-weight: 600;
  color: var(--eat-heading, #09295a);
  padding: 0;
}

.eat-field__optional,
.eat-field__hint {
  font-weight: 400;
  color: var(--eat-muted, #4a5872);
  font-size: 0.9375rem;
  margin: 0;
}

.eat-field__error {
  margin: 0;
  color: var(--eat-error, #b3261e);
  font-weight: 500;
}

.eat-form select,
.eat-form textarea,
.eat-form input[type="number"] {
  inline-size: 100%;
  font: inherit;
  color: var(--eat-text, #0e1b33);
  background: var(--eat-bg, #fff);
  border: 1px solid var(--eat-border-strong, #b7c3d8);
  border-radius: var(--eat-radius-sm, 8px);
  padding: 0.75rem 0.875rem;
  min-block-size: 3rem;
}

.eat-form textarea {
  resize: vertical;
}

.eat-form select:focus-visible,
.eat-form textarea:focus-visible,
.eat-form input:focus-visible,
.eat-form button:focus-visible {
  outline: 3px solid var(--eat-focus, #0a46b4);
  outline-offset: 2px;
}

.eat-form [aria-describedby*="eat-err-"] {
  border-color: var(--eat-error, #b3261e);
}

/* direction: two big choices instead of radio dots */
.eat-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.eat-choice__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--eat-border-strong, #b7c3d8);
  border-radius: var(--eat-radius-sm, 8px);
  background: var(--eat-bg, #fff);
  cursor: pointer;
  font-weight: 500;
}

.eat-choice__option input {
  accent-color: var(--eat-accent, #0a46b4);
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin: 0;
}

.eat-choice__option:has(input:checked) {
  border-color: var(--eat-accent, #0a46b4);
  box-shadow: inset 0 0 0 1px var(--eat-accent, #0a46b4);
  background: var(--eat-surface, #f4f7fc);
}

.eat-choice__option:has(input:focus-visible) {
  outline: 3px solid var(--eat-focus, #0a46b4);
  outline-offset: 2px;
}

/* pages */
.eat-stepper {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  max-inline-size: 14rem;
}

/* number fields: our own − and + buttons, so the browser's spin arrows go (they also pushed the number off centre) */
.eat-form input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.eat-form input[type="number"]::-webkit-inner-spin-button,
.eat-form input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.eat-stepper input[type="number"] {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.eat-stepper__btn {
  flex: 0 0 3rem;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--eat-accent, #0a46b4);
  background: var(--eat-surface, #f4f7fc);
  border: 1px solid var(--eat-border-strong, #b7c3d8);
  border-radius: var(--eat-radius-sm, 8px);
  cursor: pointer;
}

/* files */
.eat-drop {
  border: 2px dashed var(--eat-border-strong, #b7c3d8);
  border-radius: var(--eat-radius, 14px);
  background: var(--eat-surface, #f4f7fc);
  padding: 1.25rem;
}

.eat-drop input[type="file"] {
  inline-size: 100%;
  font: inherit;
  color: var(--eat-text, #0e1b33);
}

.eat-drop input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin-inline-end: 1rem;
  padding: 0.625rem 1rem;
  border: 0;
  border-radius: var(--eat-radius-sm, 8px);
  background: var(--eat-navy, #09295a);
  color: #fff;
  cursor: pointer;
}

.eat-drop__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.375rem;
}

.eat-drop__list:not(:empty) {
  margin-block-start: 1rem;
}

.eat-drop__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9375rem;
}

.eat-drop__name {
  overflow-wrap: anywhere;
}

.eat-drop__size {
  color: var(--eat-muted, #4a5872);
  white-space: nowrap;
}

.eat-drop__problem {
  color: var(--eat-error, #b3261e);
  font-weight: 500;
}

/* total + submit */
.eat-form__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 1rem;
  border-block: 1px solid var(--eat-border, #dce3ef);
  font-size: 1.125rem;
}

.eat-form__total-amount {
  font-size: 1.75rem;
  color: var(--eat-heading, #09295a);
}

.eat-form__submit {
  inline-size: 100%;
}

.eat-form__submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

.eat-form__privacy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--eat-muted, #4a5872);
}

.eat-form__alert {
  padding: 1rem 1.25rem;
  border-radius: var(--eat-radius-sm, 8px);
  border-inline-start: 4px solid var(--eat-error, #b3261e);
  background: var(--eat-error-bg, #fdecea);
  color: var(--eat-text, #0e1b33);
}

.eat-form__alert:focus {
  outline: none;
}

.eat-form__alert-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.eat-form__alert ul {
  margin: 0 0 0.5rem;
  padding-inline-start: 1.25rem;
}

.eat-form__alert p:last-child {
  margin-block-end: 0;
}

/* off-screen for people, still in the DOM for bots */
.eat-form__hp {
  position: absolute;
  inset-inline-start: -10000px;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .eat-form * {
    transition: none !important;
  }
}

/* ---------- three parts ---------- */

.eat-form {
  gap: 2.5rem;
}

.eat-form__part {
  display: grid;
  gap: 1.25rem;
}

.eat-form__part-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.375rem;
  color: var(--eat-heading, #09295a);
}

.eat-form__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  inline-size: 2rem;
  block-size: 2rem;
  border-radius: 50%;
  background: var(--eat-navy, #09295a);
  color: #fff;
  font-family: var(--eat-font, inherit);
  font-size: 0.9375rem;
  font-weight: 600;
}

.eat-form__row {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 40rem) {
  .eat-form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.eat-form input[type="text"],
.eat-form input[type="email"],
.eat-form input[type="tel"],
.eat-form input[type="date"] {
  inline-size: 100%;
  font: inherit;
  font-size: max(1rem, 16px);   /* under 16px iOS zooms into the field */
  color: var(--eat-text, #0e1b33);
  background: var(--eat-bg, #fff);
  border: 1px solid var(--eat-border-strong, #b7c3d8);
  border-radius: var(--eat-radius-sm, 12px);
  padding: 0.75rem 0.875rem;
  min-block-size: 3rem;
}

.eat-form [aria-invalid="true"] {
  border-color: var(--eat-error, #b3261e);
}

/* delivery cards */
.eat-choice--cards {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.eat-choice--cards .eat-choice__option {
  align-items: flex-start;
  padding: 1.25rem;
}

.eat-choice--cards .eat-choice__option input {
  margin-block-start: 0.125rem;
}

.eat-choice__body {
  display: grid;
  gap: 0.25rem;
}

.eat-choice__title {
  font-weight: 600;
  color: var(--eat-heading, #09295a);
}

.eat-choice__text {
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--eat-muted, #4a5872);
}

.eat-form__post {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--eat-radius, 16px);
  background: var(--eat-surface, #f4f7fc);
}

.eat-form__post[hidden] {
  display: none;
}

/* summary */
.eat-form__summary {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--eat-radius, 16px);
  border: 1px solid var(--eat-border, #dce3ef);
  background: var(--eat-card, #fff);
}

.eat-form__summary .eat-form__total {
  padding: 0;
  border: 0;
}

.eat-form__total-amount {
  font-variant-numeric: tabular-nums;
}

.eat-form__paylater {
  margin: 0;
  font-weight: 500;
  color: var(--eat-heading, #09295a);
}

.eat-check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
}

.eat-check input {
  flex: none;
  inline-size: 1.375rem;
  block-size: 1.375rem;
  margin: 0;
  accent-color: var(--eat-accent, #0a46b4);
}

.eat-visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* the postage price under each service: a sum, kept left to right on the Hebrew page and next to the title */
.eat-choice__text[data-postage-price] {
  direction: ltr;
  unicode-bidi: isolate;
  justify-self: start;
  font-weight: 600;
  color: var(--eat-heading, #09295a);
  font-variant-numeric: tabular-nums;
}

/* iOS Safari gives the date field its own minimum width, wider than a phone column: drop the native look so it
   takes the column's width like the other fields */
.eat-form input[type="date"] {
  display: block;
  -webkit-appearance: none;
  appearance: none;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.eat-form input[type="date"]::-webkit-date-and-time-value {
  text-align: start;
  min-block-size: 1.5em;
}

/* email confirmation with a code (quote mode, includes/otp.php) */
.eat-otp { display: grid; gap: 0.75rem; padding: 1rem 1.25rem; border: 1px dashed var(--eat-border-strong, #b7c3d8); border-radius: var(--eat-radius-sm, 12px); }
.eat-otp__send, .eat-otp__check { display: grid; gap: 0.5rem; justify-items: start; }
.eat-otp__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.eat-otp [hidden] { display: none !important; }
.eat-form .eat-otp__row input { inline-size: 9rem; min-block-size: 3rem; font: inherit; font-size: 1.25rem; letter-spacing: 0.3em; text-align: center; padding: 0.625rem 0.75rem; color: var(--eat-text, #0e1b33); background: var(--eat-bg, #fff); border: 1px solid var(--eat-border-strong, #b7c3d8); border-radius: var(--eat-radius-sm, 8px); }
.eat-otp__again { font: inherit; font-size: 0.9375rem; padding: 0; border: 0; background: none; color: var(--eat-link, var(--eat-accent, #0a46b4)); text-decoration: underline; cursor: pointer; }
.eat-otp__status { margin: 0; font-weight: 500; color: var(--eat-heading, #09295a); }
.eat-otp__status:empty { display: none; }
.eat-otp__status.is-error { color: var(--eat-error, #b3261e); }
.eat-otp.is-confirmed { border-style: solid; border-color: var(--eat-success, #1b7a4b); }
.eat-otp.is-confirmed .eat-otp__status::before { content: "\2713\00a0"; color: var(--eat-success, #1b7a4b); }

.eat-form__mailnote { margin: 0; color: var(--eat-muted, #5b6578); font-size: 0.9375rem; }

/* document types: several can be ticked */
.eat-doctypes { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.eat-doctypes__list { display: grid; gap: 0.5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); margin-block-start: 0.25rem; }
@media (min-width: 40rem) { .eat-doctypes__list { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); } }
.eat-doctypes__option { align-items: flex-start; gap: 0.5rem; padding: 0.25rem 0; line-height: 1.35; }

/* a button waiting for the server (email code): a spinner, and no second click */
.eat-otp button.is-busy { cursor: progress; opacity: 1; }
.eat-otp button.is-busy::before {
  content: "";
  display: inline-block;
  inline-size: 1em;
  block-size: 1em;
  margin-inline-end: 0.5em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: eat-spin 0.7s linear infinite;
}
@keyframes eat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eat-otp button.is-busy::before { animation-duration: 1.6s; } }
