/* ============================================================
   food-order-redesign.css — the three pre-auth meal-order pages
   (food-order-form / -list / -download). Page-scoped.

   Design read: a technical drawing on white paper. Fine blue
   graticule, registration marks at the panel's corners, and a
   title block in the bottom-right corner the way a real drawing
   carries one. It is the light twin of the login page's circuit
   board: same family, same brand blue, different artifact — the
   two tabs at the top of each page hand off between them.

   Nothing in the title block is invented. An earlier draft
   carried "SCALE 1:1 / SHEET 01/01", which looks authoritative
   and says nothing; every row here is a fact about the page you
   are on.

   The controls are not restyled. .form-control, .btn and
   .btn-primary come from custom.css exactly as they do inside the
   app, so a field or a button here is the same object as one behind
   the login — only the surface they sit on is this page's. What is
   left duplicated between here and login-redesign.css is the 8px
   radius on the captcha box and the tab strip, which are not
   Bootstrap components and so cannot inherit it; if custom.css's
   radius ever moves, move those two as well.

   --brand / --ink / --line / --surface come from custom.css's
   :root. --fo-* below are these pages only.
   ============================================================ */

:root{
  --fo-paper:      #f6f7f8;
  --fo-grid-fine:  rgba(14,92,147,.06);
  --fo-grid-major: rgba(14,92,147,.12);
  --fo-ink-draw:   #5b7f9c;
  --fo-ink-faint:  #8aa4b6;
  --fo-panel-line: #c3d1db;
  /* matches custom.css's .form-control border so the captcha box and
     the choice groups, which are not .form-controls, line up with the
     inputs */
  --fo-field-line: #dde1e6;
  --fo-field-bg:   #fcfdfe;
  --fo-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, Menlo, monospace;
}

/* ---------- sheet ---------- */
.fo-sheet{
  position:relative;
  min-height:100vh;
  background:var(--fo-paper);
  overflow:hidden;
  font-family:"Be Vietnam Pro","PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif;
  color:var(--ink);
}
/* graticule: 26px fine, 130px major — drawn as backgrounds on a
   pointer-events-free layer so it never intercepts clicks */
.fo-sheet::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(var(--fo-grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--fo-grid-fine) 1px, transparent 1px),
    linear-gradient(var(--fo-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--fo-grid-major) 1px, transparent 1px);
  background-size:26px 26px, 26px 26px, 130px 130px, 130px 130px;
}

.fo-ref{
  position:absolute; top:32px; left:44px; z-index:2;
  font-family:var(--fo-mono);
  font-size:11px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--fo-ink-draw);
}

/* ---------- language selector ----------
   x-lang-dropdown is shared app-wide and ships a solid .btn-primary
   plus float-end; both are neutralised so it reads as a drawing
   annotation rather than a call to action. */
.fo-lang{ position:absolute; top:24px; right:44px; z-index:3; }
.fo-lang .dropdown-toggle.btn{
  float:none;
  background:var(--surface); border:1px solid #b6c8d6; color:#4a6c86;
  font-size:13px; font-weight:500; border-radius:8px; padding:7px 13px;
  box-shadow:none;
}
.fo-lang .dropdown-toggle.btn:hover,
.fo-lang .dropdown-toggle.btn:focus{
  background:var(--surface); border-color:var(--brand); color:var(--brand);
}

/* ---------- title block ----------
   Bottom-right, the way a drawing carries one. Every row is true:
   the page's own title, the system it belongs to, its route. */
.fo-titleblock{
  position:absolute; right:44px; bottom:32px; z-index:2;
  border:1px solid #9db4c6; background:var(--surface);
  font-family:var(--fo-mono); font-size:9.5px; color:#4a6c86;
}
.fo-titleblock div{ display:flex; }
.fo-titleblock div + div{ border-top:1px solid #cfdce6; }
.fo-titleblock dt{
  width:64px; padding:5px 9px; margin:0;
  border-right:1px solid #cfdce6;
  letter-spacing:.12em; color:var(--fo-ink-faint); font-weight:400;
}
.fo-titleblock dd{
  width:200px; padding:5px 9px; margin:0;
  letter-spacing:.06em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

/* ---------- panel ---------- */
.fo-center{
  position:relative; z-index:2;
  min-height:100vh;
  display:flex; align-items:center; justify-content:center;
  padding:88px 20px 96px;
}
/* the registration marks hang outside the panel, so they live on a
   wrapper rather than on the panel's own box */
.fo-mount{ position:relative; width:100%; max-width:456px; }
.fo-mount--wide{ max-width:720px; }
.fo-mount::before,.fo-mount::after,
.fo-mount > .fo-corner::before,.fo-mount > .fo-corner::after{
  content:""; position:absolute; width:18px; height:18px; pointer-events:none;
}
.fo-mount::before{ top:-16px; left:-16px; border-top:1.5px solid var(--brand); border-left:1.5px solid var(--brand); }
.fo-mount::after{ top:-16px; right:-16px; border-top:1.5px solid var(--brand); border-right:1.5px solid var(--brand); }
.fo-mount > .fo-corner::before{ bottom:-16px; left:-16px; border-bottom:1.5px solid var(--brand); border-left:1.5px solid var(--brand); }
.fo-mount > .fo-corner::after{ bottom:-16px; right:-16px; border-bottom:1.5px solid var(--brand); border-right:1.5px solid var(--brand); }
.fo-corner{ position:absolute; inset:0; pointer-events:none; }

.fo-panel{
  position:relative;
  background:var(--surface);
  border:1px solid var(--fo-panel-line);
  border-radius:4px;
  padding:34px 38px;
  box-shadow:0 8px 26px rgba(20,45,70,.07);
}

.fo-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  margin-bottom:18px;
}
.fo-title{
  font-size:19px; font-weight:700; letter-spacing:-.01em; margin:0;
  color:var(--ink);
}
.fo-sheetno{
  flex:0 0 auto; text-align:right;
  font-family:var(--fo-mono); font-size:9.5px; letter-spacing:.12em;
  color:var(--fo-ink-faint); line-height:1.7;
}
.fo-rule{ height:2px; background:var(--brand); margin-bottom:22px; }

/* ---------- the two systems these pages sit behind ---------- */
.fo-tabs{
  display:flex; margin-bottom:24px;
  border:1px solid var(--fo-panel-line); border-radius:8px; overflow:hidden;
}
.fo-tabs a{
  flex:1; text-align:center; padding:9px 6px;
  font-size:13.5px; font-weight:500; color:var(--ink-soft);
  text-decoration:none; background:var(--surface);
  transition:background .12s ease, color .12s ease;
}
.fo-tabs a + a{ border-left:1px solid var(--fo-panel-line); }
.fo-tabs a:hover{ background:#f2f6f9; color:var(--brand); }
.fo-tabs a.active,.fo-tabs a.active:hover{ background:var(--brand); color:#fff; font-weight:700; }

/* ---------- fields ---------- */
.fo-field{ margin-bottom:16px; }
.fo-field label{
  display:block; font-family:var(--fo-mono);
  font-size:9.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:7px;
}
/* height, radius, border and focus ring all come from custom.css's
   own .form-control — these pages deliberately do not restyle the
   controls, only the surface they sit on, so a field here and a field
   inside the app are the same object. */
.fo-field .form-control::placeholder{ color:var(--ink-faint); }
.fo-field .form-control[readonly]{ background:#f1f4f6; color:var(--ink-soft); }

/* verify code: one control. Captcha is 130x36 (config/captcha.php);
   object-fit:contain letterboxes it, so digits are never cropped.
   152px on desktop, 128px below 576px — sized so the Vietnamese
   placeholder beside it fits at both widths, same as the login page. */
.fo-captcha-row{ display:flex; gap:9px; align-items:stretch; }
.fo-captcha-row .form-control{ flex:1; min-width:0; }
.fo-captcha-img{
  flex:0 0 auto; width:152px; height:44px;
  border:1px solid var(--fo-field-line); border-radius:8px;
  overflow:hidden; cursor:pointer; background:var(--surface);
  display:flex; align-items:center; justify-content:center;
  transition:border-color .15s ease;
}
.fo-captcha-img:hover{ border-color:var(--brand); }
.fo-captcha-img img{ width:100%; height:100%; object-fit:contain; display:block; }
.fo-captcha-img .psnloaddiv{ display:none; }

/* ---------- choice groups (list page) ---------- */
.fo-group{ margin-bottom:20px; }
.fo-group > .fo-group-label{
  display:block; font-family:var(--fo-mono);
  font-size:9.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:10px;
}
.fo-choices{
  display:flex; flex-wrap:wrap; gap:10px 22px;
  border:1px solid var(--fo-field-line); border-radius:8px;
  padding:14px 16px; background:var(--fo-field-bg);
}
.fo-choices .form-check{ margin:0; min-height:auto; }
.fo-choices .form-check-label{
  font-size:14px; color:var(--ink); cursor:pointer;
}
.fo-choices .form-check-input:disabled + .form-check-label{
  color:var(--ink-faint); cursor:not-allowed;
}

/* ---------- actions ---------- */
.fo-submit{ margin-top:24px; }
/* .btn.btn-primary carries the colour, height, radius and type;
   only the full-width stretch is page layout. */
.fo-btn{ width:100%; }

/* ---------- recent orders (list page) ---------- */
.fo-recent{ margin-top:30px; }
.fo-recent-label{
  font-family:var(--fo-mono);
  font-size:9.5px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--ink-soft); margin-bottom:10px;
}
.fo-table-wrap{ overflow-x:auto; }
.fo-table{
  width:100%; margin:0; border-collapse:collapse; font-size:13.5px;
}
.fo-table th,.fo-table td{
  border:1px solid var(--fo-panel-line); padding:8px 11px; text-align:left;
  white-space:nowrap;
}
.fo-table th{
  background:#eef3f7; font-weight:600; color:var(--ink-soft);
  font-size:12.5px; letter-spacing:.02em;
}
.fo-table td{ color:var(--ink); font-variant-numeric:tabular-nums; }
.fo-table tbody tr:nth-child(even) td{ background:#fafbfc; }
.fo-table .fo-empty{ color:var(--ink-faint); text-align:center; white-space:normal; }

/* ---------- narrow screens ----------
   Below the panel's own width the drawing furniture stops earning
   its space — the graticule crops to noise and the title block
   crowds the panel — so both step out rather than shrink. */
@media (max-width:767.98px){
  .fo-titleblock{ display:none; }
}
@media (max-width:575.98px){
  .fo-ref{ display:none; }
  .fo-lang{ top:16px; right:16px; }
  .fo-center{ padding:72px 14px 32px; }
  .fo-panel{ padding:26px 22px; }
  .fo-mount::before,.fo-mount::after,
  .fo-mount > .fo-corner::before,.fo-mount > .fo-corner::after{ display:none; }
  .fo-captcha-img{ width:128px; }
  .fo-head{ flex-direction:column; gap:6px; }
  .fo-sheetno{ text-align:left; }
}
@media (max-width:359.98px){
  .fo-captcha-row{ flex-wrap:wrap; }
  .fo-captcha-row .form-control{ flex:1 0 100%; }
  .fo-captcha-img{ width:100%; }
}

@media (prefers-reduced-motion:reduce){
  .fo-tabs a,.fo-captcha-img{ transition:none; }
}
