/* ============================================================
   InCode AI — the «اطلب موقعك» form inside the white card (order.js;
   the feature 002 form restyled for redesign v2, payment and receipt
   parts removed 2026-10-20: grey fields, labels above, yellow pill submit).
   The card is narrow on a wide screen, so the layout follows the card's
   width (container queries), not the screen's.
   ============================================================ */

#order-form-slot {
  container-type: inline-size;
  --green: #17803F;
  --red: #C62D1F;
  --field: #F1F1F1;
}

/* --- The form ------------------------------------------------ */

.order-form { display: grid; }
.order-form-title { font-size: 24px; font-weight: 500; color: var(--charcoal); line-height: 1.35; }
.order-form-note { margin: 6px 0 22px; font-size: 14px; color: var(--muted); line-height: 1.7; }

.order-fields { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 15px; font-weight: 400; color: var(--charcoal); }
/* The reference marks required fields with a star before the label */
.field-label::before { content: "* "; color: var(--red); }
.field--optional .field-label::before { content: none; }
.field-note { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.field-input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--field);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px; /* under 16px, phones zoom in on focus */
}
.field-input::placeholder { color: #8C8C90; }
/* The select keeps the field look; the arrow sits on the left, where RTL text ends. */
.field-select {
  appearance: none;
  padding-inline-end: 42px;
  background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0B0C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") left 14px center / 18px no-repeat;
  cursor: pointer;
}
.field-select:invalid, .field-select option[value=""] { color: #8C8C90; }
.field-select option { color: var(--ink); }
.field-textarea { min-height: 120px; padding-block: 12px; line-height: 1.7; resize: vertical; }
.field-input:focus-visible { outline: 2px solid var(--yellow); outline-offset: 1px; background: var(--white); border-color: #CFCFD3; }
.field-input[aria-invalid="true"] { border-color: var(--red); background: #FFF6F5; }
.field-error { font-size: 13px; color: var(--red); line-height: 1.6; }
.field-error:empty { display: none; }

/* The honeypot: gone for people, still there for a bot that fills every input. */
.field-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Submit, then WhatsApp as the other way --------------------- */

/* The reference's submit: a yellow pill with a white circle holding an arrow. order.js sets
   the button's text, so the circle is drawn by CSS, not markup. */
.order-submit {
  position: relative;
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  padding-block: 8px;
  padding-inline: 24px 64px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font);
  font-size: 19px;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}
.order-submit:active:not(:disabled) { transform: scale(0.98); }
.order-submit::after {
  content: "";
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border-radius: 50%;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0B0C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 19-7-7 7-7'/%3E%3Cpath d='M19 12H5'/%3E%3C/svg%3E") center / 22px no-repeat;
  transition: transform 200ms ease;
}
.order-submit:hover:not(:disabled) { background: var(--yellow-press); }
@media (hover: hover) and (pointer: fine) { .order-submit:hover:not(:disabled)::after { transform: translateX(-4px); } }
.order-submit:disabled { opacity: .6; cursor: progress; }

.order-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}
.order-or::before, .order-or::after { content: ""; height: 1px; background: var(--line); }
.order-whatsapp-direct {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 14px;
  border: 2px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease;
}
.order-whatsapp-direct:hover { background: var(--green); color: var(--white); }

/* --- After submit -------------------------------------------- */

.order-result {
  display: grid; justify-items: center; gap: 14px; padding: 32px 16px; border-radius: 8px; text-align: center;
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}
@starting-style { .order-result { opacity: 0; transform: translateY(8px); } }
.order-result--success { border: 2px solid var(--green); background: #F2FAF5; }
.order-result--failure { border: 2px solid var(--red); background: #FFF6F5; }
.result-title { font-size: 24px; font-weight: 700; color: var(--charcoal); }
.result-text { max-width: 42ch; font-size: 16px; line-height: 1.8; color: var(--muted); }
.result-button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.result-button--whatsapp { background: var(--green); color: var(--white); }
.result-button--retry { background: var(--yellow); color: var(--ink); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* --- Wider card ---------------------------------------------- */

@container (min-width: 460px) {
  .order-fields { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .order-submit::after { transition: none; }
  .order-submit:hover:not(:disabled)::after { transform: none; }
  .order-submit:active:not(:disabled) { transform: none; }
  .order-result { transition: opacity 400ms var(--ease-out); }
  @starting-style { .order-result { transform: none; } }
}
