/* network-consumer.css
   Beavy Network — consumer pages (/login, /request, /request/:id, /request/history)

   Follows the Beavy CI in AGENTS.md. Kept separate from styles.css because these
   are public marketplace pages with no app shell: no sidebar, no nav, no tenant
   context. Mobile-first — most consumers arrive from a LINE Rich Menu. */

:root {
  --bg: #FAF9F7;
  --surface: #FFFFFF;
  --text: #1B2D4F;
  --text-sub: #94A3B8;
  --border-card: #E8E4DF;
  --border-ui: #EEF2F7;
  --accent: #C8392B;
  --blue: #1B6CA8;
  --green: #1A7A4A;
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-pill: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Never a horizontal scrollbar (AGENTS.md mobile rule). */
html, body { overflow-x: hidden; max-width: 100%; }

.net-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.net-head { margin-bottom: 20px; }

.net-brand {
  font-family: 'Prompt', 'Noto Sans Thai', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  margin: 0 0 4px;
}

.net-title { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.net-sub { font-size: 14px; color: var(--text-sub); margin: 0; }

.net-card {
  background: var(--surface);
  border: 0.5px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 18px;
  margin-bottom: 14px;
}

/* ---------- form ---------- */

.net-field { margin-bottom: 16px; }

.net-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.net-hint { font-size: 12px; color: var(--text-sub); margin: 4px 0 0; }

.net-input, .net-select, .net-textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-btn);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;   /* 16px-ish keeps iOS from zooming on focus */
}

.net-textarea { min-height: 84px; resize: vertical; }

.net-input:focus, .net-select:focus, .net-textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.net-field.is-invalid .net-input,
.net-field.is-invalid .net-select,
.net-field.is-invalid .net-textarea { border-color: var(--accent); }

.net-row { display: flex; gap: 10px; }
.net-row > * { flex: 1; min-width: 0; }

.net-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}

.net-consent input { margin-top: 3px; flex-shrink: 0; width: 18px; height: 18px; }

/* NETWORK-SHOP-APP-1 */
.net-consent-terms { font-size: 13px; color: var(--text-sub); margin: 0 0 10px; }
.net-consent-terms p { margin: 0 0 6px; }
.net-field-error { font-size: 12px; color: var(--accent); margin: 4px 0 0; }

/* Customer pages (UX #6, #19): grouped form; GPS first, the area as fallback. */
.net-group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.net-group-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; padding: 0; }
.net-group.is-invalid > .net-btn-primary { outline: 2px solid var(--accent); outline-offset: 2px; }
.net-area { margin: 10px 0 0; padding: 12px; border: 0.5px solid var(--border-card); border-radius: 12px; }
.net-btn-link.is-offered { font-weight: 600; }
#btn-area { display: block; margin: 8px 0 0; }
#submit-error { margin: 10px 0 0; }
.net-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 14px; }
.net-facts dt { color: var(--text-sub); }
.net-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.net-mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 400; }
.net-offer-time { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; }

/* Dialogs (NETWORK-SHOP-APP-1) — in-page only, never the browser's native dialogs. */
.net-modal { position: fixed; inset: 0; background: rgba(27, 45, 79, 0.45); display: flex; align-items: flex-end;
  justify-content: center; padding: 16px; z-index: 50; }
.net-modal-card { background: var(--surface); border-radius: var(--radius-card); padding: 20px; width: 100%;
  max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; box-sizing: border-box; }
@media (min-width: 640px) { .net-modal { align-items: center; } }
.net-btn, .net-input, .net-select { min-height: 48px; }
.net-btn-ghost { min-height: 48px; }

/* ---------- buttons ---------- */

.net-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.net-btn:disabled { opacity: 0.55; cursor: default; }

.net-btn-primary { background: var(--accent); color: #fff; }
.net-btn-blue { background: var(--blue); color: #fff; }
.net-btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-ui);
}

.net-btn-provider {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-ui);
  margin-bottom: 10px;
}

.net-btn-link {
  background: none;
  border: none;
  color: var(--blue);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  width: auto;
}

.net-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-sub);
  font-size: 13px;
  margin: 16px 0;
}
.net-or::before, .net-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-ui);
}

/* ---------- status / feedback ---------- */

.net-alert {
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
}
.net-alert-error { background: #FDECEA; color: var(--accent); }
.net-alert-info { background: #E8F2FB; color: var(--blue); }
.net-alert-ok { background: #E6F7F1; color: var(--green); }

.net-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: #F1F5F9;
  color: #64748B;
}
.net-pill-open { background: #E8F2FB; color: var(--blue); }
.net-pill-awaiting { background: #FEF3E8; color: #E07B2A; }
.net-pill-matched { background: #E6F7F1; color: var(--green); }
.net-pill-expired { background: #F1F5F9; color: #64748B; }

.net-countdown {
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
  margin: 0 0 14px;
}

/* ---------- shop offer card ---------- */

.net-offer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-ui);
}
.net-offer:last-child { border-bottom: none; }
/* UX review #3: offers not chosen, folded under the chosen shop. */
/* UX review #4: the job's steps on the booking card. */
.net-steps { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 8px; }
.net-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-sub); }
.net-step-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-card); background: var(--surface); flex: 0 0 auto; }
.net-step.is-done { color: var(--text); }
.net-step.is-done .net-step-dot { background: var(--green); border-color: var(--green); }
.net-step.is-current { color: var(--text); font-weight: 600; }
.net-step.is-current .net-step-dot { background: var(--accent); border-color: var(--accent); }
.net-phone { margin: 12px 0 0; font-size: 18px; font-weight: 600; letter-spacing: .02em; user-select: all; }
.net-others summary { cursor: pointer; font-weight: 600; color: var(--text-sub); padding: 4px 0; }
.net-others summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.net-others[open] summary { margin-bottom: 6px; }

.net-offer-main { flex: 1; min-width: 0; }
.net-offer-name {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}
.net-offer-meta { font-size: 13px; color: var(--text-sub); }
.net-offer-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.net-offer-action { flex-shrink: 0; }
.net-offer-action .net-btn { width: auto; padding: 9px 14px; font-size: 14px; }

/* ---------- history ---------- */

.net-history-item {
  display: block;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border-ui);
  padding: 14px 0;
}
.net-history-item:last-child { border-bottom: none; }
.net-history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.net-history-title { font-size: 15px; font-weight: 600; }
.net-history-meta { font-size: 13px; color: var(--text-sub); }

/* ---------- empty / skeleton ---------- */

.net-empty { text-align: center; padding: 28px 12px; color: var(--text-sub); }
.net-empty p { margin: 0 0 14px; font-size: 14px; }

.net-skel {
  background: linear-gradient(90deg, #F1F5F9 25%, #E8E4DF 37%, #F1F5F9 63%);
  background-size: 400% 100%;
  animation: net-shimmer 1.3s ease infinite;
  border-radius: 6px;
  height: 14px;
  margin-bottom: 10px;
}
.net-skel.wide { width: 70%; }
.net-skel.short { width: 40%; }

@keyframes net-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .net-skel { animation: none; }
}

/* ---------- footer bar ---------- */

.net-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-sub);
}

.net-hidden { display: none !important; }

@media (max-width: 480px) {
  .net-shell { padding: 16px 14px 40px; }
  .net-title { font-size: 20px; }
  .net-row { flex-direction: column; gap: 0; }
}

/* Shop inbox tabs and job cards (NETWORK-SHOP-APP-1) */
.net-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.net-tab { flex: 1 1 0; min-height: 48px; padding: 0 10px; border: 1px solid var(--border-card); border-radius: var(--radius-btn);
  background: var(--surface); color: var(--text-sub); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.net-tab[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.net-tab:focus-visible, .net-job-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.net-job-card { display: block; color: inherit; text-decoration: none; }
.net-job-confirmed { background: #E8F2FB; color: var(--blue); }
.net-job-traveling, .net-job-arrived, .net-job-working { background: #FEF3E8; color: #E07B2A; }
.net-job-done { background: #E6F7F1; color: var(--green); }
.net-job-paid { background: #E6F7F1; color: var(--green); font-weight: 700; }
.net-job-cancelled, .net-job-unknown { background: #F1F5F9; color: #64748B; }

/* Shop job detail (NETWORK-SHOP-APP-1) */
.net-row-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 0.5px solid var(--border-card); }
.net-row-item:last-of-type { border-bottom: none; }
.net-row-item .net-label { margin: 0; flex: 0 0 auto; }
.net-value { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.net-units { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; color: var(--text-sub); }
a.net-btn { text-decoration: none; box-sizing: border-box; }
#actions { margin-top: 4px; }
