/* Light platform pages: signup, login, staff PIN, setup wizard. Same world as the cashier screen. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap");

:root {
  --paper: #fafafa;
  --card: #ffffff;
  --ink: #18181b;
  --ink-2: #52525b;
  --line: #e4e4e7;
  --brand: #e8590c;
  --brand-ink: #b8440a; /* brand orange dark enough for text and buttons with white */
  --brand-soft: #fde4d3;
  --danger: #b42318;
  --ok: #1f7a46;
  --radius: 14px;
  font-family: "Geist", "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout classes (.field, .view…) must never un-hide */
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { -webkit-font-smoothing: antialiased; line-height: 1.5; }
::selection { background: var(--brand-soft); color: var(--ink); }
a { color: var(--brand-ink); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.wordmark img { width: 34px; height: 34px; border-radius: 9px; }

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance; }
h2 { font-size: 1.35rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.lead { color: var(--ink-2); font-size: 1.05rem; margin: 0 0 24px; max-width: 46ch; }
.muted { color: var(--ink-2); }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 500; font-size: .95rem; }
.field .help { font-size: .85rem; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input:not([type]) {
  font: inherit; font-size: 1rem;
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s ease-out;
}
input:hover { border-color: #d4d4d8; }
input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input::placeholder { color: #6b6b74; } /* 4.9:1 on white */

.btn {
  font: inherit; font-weight: 600; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: var(--brand-ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease-out, transform .1s ease-out;
}
.btn:hover { background: #9c3908; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--card); border-color: #d3c6b1; }
.btn.block { width: 100%; }

.error {
  color: var(--danger); background: #fdecea; border-radius: 10px;
  padding: 10px 12px; font-size: .95rem; margin: 0 0 16px;
}
.error:empty { display: none; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(22px, 4vw, 36px);
  box-shadow: 0 18px 50px -30px rgba(27, 23, 18, .35);
}

/* centered single-card pages (login, PIN) */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center-page .card { width: min(420px, 100%); }
.center-page .wordmark { margin-bottom: 22px; }

/* 6-box PIN (pin-input.js) */
.pin { display: flex; gap: 8px; }
.pin input {
  width: 100%; max-width: 52px; aspect-ratio: 1 / 1.15;
  padding: 0; text-align: center;
  font-size: 1.6rem; font-weight: 600;
  -webkit-text-security: disc; /* show dots, keep the numeric keypad */
  caret-color: var(--brand);
}
.pin.invalid input { border-color: var(--danger); animation: shake .35s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .pin.invalid input { animation: none; } }

/* brand inputs (brand-kit.js) */
  .drop {
    display: flex; align-items: center; gap: 14px;
    border: 1.5px dashed #d3c6b1; border-radius: 12px; padding: 14px; cursor: pointer;
    background: var(--card); transition: border-color .15s ease-out;
  }
  .drop:hover, .drop.over { border-color: var(--brand); }
  .drop img { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: var(--paper); }
  .drop strong { display: block; font-weight: 600; }
  .drop span { font-size: .85rem; color: var(--ink-2); }
  /* brand color: picker square + hue, hex box, quick picks */
  .color-field { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 18px; align-items: start;
    background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; }
  hex-color-picker { width: 100%; height: 170px; }
  hex-color-picker::part(saturation) { border-radius: 10px 10px 0 0; border-bottom-width: 10px; }
  hex-color-picker::part(hue) { height: 18px; border-radius: 0 0 10px 10px; }
  hex-color-picker::part(saturation-pointer), hex-color-picker::part(hue-pointer) { width: 22px; height: 22px; }
  .color-side { display: grid; gap: 12px; min-width: 0; }
  .hex-row { display: flex; align-items: center; gap: 10px; }
  .hex-row .chip { width: 44px; height: 44px; border-radius: 10px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
  .hex-input { position: relative; flex: 1; }
  .hex-input span { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
  .hex-input input { padding-inline-start: 26px; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: .04em; }
  .pick-label { font-size: .8rem; color: var(--ink-2); margin-bottom: 6px; }
  .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
  .swatch { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--card); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
  .swatch:hover { transform: scale(1.08); }
  .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink); }
  .color-warn { font-size: .85rem; color: #8a5a00; }
  .color-warn:empty { display: none; }
  @media (max-width: 480px) { .color-field { grid-template-columns: 1fr; } }

/* location field (brand-kit.js) */
.loc { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.loc-status { font-size: .9rem; }
.loc-status.ok { color: var(--ok); }
.loc-status a { margin-inline-start: 6px; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; margin-inline-start: 8px; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* owner pages top bar */
.topbar { display: flex; align-items: center; gap: 20px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.topbar nav { display: flex; gap: 18px; margin-inline-start: auto; font-size: .95rem; }
.topbar nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
@media (max-width: 520px) { .topbar { gap: 12px; } .topbar nav { gap: 12px; font-size: .88rem; } .topbar .wordmark { font-size: 0; gap: 0; } }
.topbar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
