/* ============================================================
   SAUCE — Auth & session-picker screens (M4.2)
   Additive stylesheet; consumes the design tokens defined in
   colors_and_type.css. Keeps the same crisp/confident language
   as the wizard (paper cards, cool greys, red-orange primary).
   ============================================================ */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background:
    radial-gradient(1100px 520px at 85% -10%, var(--red-50), transparent 60%),
    var(--grey-100);
}

.auth-card {
  width: 420px;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 34px 34px 30px;
}

.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-logo img { height: 24px; display: block; }
.auth-logo span {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--ink-600); letter-spacing: -0.01em;
  border-left: 1px solid var(--grey-200); padding-left: 12px;
}

.auth-title {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: -0.02em; color: var(--ink-800); margin: 0 0 6px; line-height: 1.15;
}
.auth-sub { font-size: 14.5px; line-height: 1.55; color: var(--ink-600); margin: 0 0 22px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-field { position: relative; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-600); }
.auth-field input {
  border: 1.5px solid var(--grey-200); border-radius: var(--radius-md);
  padding: 11px 14px; font-size: 14px; color: var(--ink-800);
  background: var(--paper); outline: none; font-weight: 500; width: 100%;
}
.auth-field input:focus { border-color: var(--red-400); }
/* Native email/phone format feedback once the owner has typed something
   non-blank (plan §5.8) — untouched required fields stay neutral. */
.auth-field input:not(:placeholder-shown):invalid { border-color: var(--error); background: var(--error-bg); }

/* Restaurant-name Google Places autocomplete dropdown (2026-07 notes) —
   see js/placesAutocomplete.js. Sits directly under the input, anchored to
   the .auth-field label since the input is its last visible child. */
.rest-suggest-box {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--paper); border: 1.5px solid var(--grey-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); z-index: 20; max-height: 240px; overflow-y: auto;
}
.rest-suggest-item { padding: 10px 14px; cursor: pointer; font-weight: 500; }
.rest-suggest-item + .rest-suggest-item { border-top: 1px solid var(--grey-100); }
.rest-suggest-item:hover { background: var(--grey-50); }
.rest-suggest-main { font-size: 13.5px; font-weight: 700; color: var(--ink-800); }
.rest-suggest-sub { font-size: 11.5px; font-weight: 500; color: var(--grey-500); margin-top: 1px; }

.auth-check { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink-600); cursor: pointer; }
.auth-check input { accent-color: var(--red-500); width: 16px; height: 16px; }

.auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; font-size: 14.5px; font-weight: 700;
  border: none; border-radius: var(--radius-md); cursor: pointer;
  background: var(--red-500); color: var(--color-on-primary);
  box-shadow: var(--shadow-brand); transition: background .15s var(--ease-out);
}
.auth-btn:hover { background: var(--red-600); }
.auth-btn[disabled] { opacity: .55; pointer-events: none; }

.auth-btn--secondary {
  background: var(--paper); color: var(--ink-700);
  border: 1.5px solid var(--grey-300); box-shadow: none;
}
.auth-btn--secondary:hover { background: var(--grey-50); }

.auth-btn--ghost {
  background: transparent; color: var(--ink-600);
  border: 1px solid transparent; box-shadow: none; height: 40px;
}
.auth-btn--ghost:hover { background: var(--grey-100); }

.auth-error {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--error-text);
  background: var(--error-bg); border: 1px solid #eccdd4;
  border-radius: var(--radius-md); padding: 11px 14px;
}

.auth-notice {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  background: var(--info-bg); border: 1px solid #cfddf7;
  border-radius: var(--radius-md); padding: 11px 14px;
}

.auth-success {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--success);
  background: var(--success-bg); border: 1px solid #bfe6cb;
  border-radius: var(--radius-md); padding: 11px 14px;
}

.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: 13px; font-weight: 600; }
.auth-links a { color: var(--red-600); }

.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--grey-100); font-size: 12px; color: var(--grey-500); display: flex; align-items: center; gap: 7px; }

/* ---------- session picker ---------- */

.sessions-page { min-height: 100vh; background: var(--grey-100); }

.sessions-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; height: 60px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-200);
}
.sessions-topbar img { height: 22px; display: block; }
.sessions-topbar .who { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--grey-500); }

.sessions-body { max-width: 880px; margin: 0 auto; padding: 44px 32px 90px; }

.sessions-title { font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -0.02em; color: var(--ink-800); margin: 0 0 6px; }
.sessions-sub { font-size: 14.5px; color: var(--ink-600); margin: 0 0 26px; }

.session-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--paper); border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 18px 22px; margin-bottom: 14px;
}
.session-card .s-ico {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--red-50); color: var(--red-500);
  display: flex; align-items: center; justify-content: center;
}
.session-card .s-main { flex: 1; min-width: 0; }
.session-card .s-name { font-weight: 700; font-size: 15.5px; color: var(--ink-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-card .s-meta { font-size: 12.5px; color: var(--grey-500); margin-top: 2px; }
.session-card .s-bar { height: 6px; width: 130px; background: var(--grey-100); border-radius: var(--radius-pill); overflow: hidden; flex-shrink: 0; }
.session-card .s-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--red-500), var(--red-400)); border-radius: var(--radius-pill); }

.state-chip {
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-pill); flex-shrink: 0;
}
.state-chip--DRAFT { color: var(--grey-500); background: var(--grey-100); }
.state-chip--IN_PROGRESS { color: var(--blue-600); background: var(--info-bg); }
.state-chip--PARKED { color: var(--ink-500); background: var(--grey-100); }
.state-chip--READY_FOR_QA { color: var(--warning); background: var(--warning-bg); }
.state-chip--LIVE { color: var(--success); background: var(--success-bg); }
.state-chip--ABANDONED, .state-chip--ROLLED_BACK { color: var(--error); background: var(--error-bg); }

.sessions-empty {
  background: var(--paper); border: 1px dashed var(--grey-300);
  border-radius: var(--radius-lg); padding: 44px 32px; text-align: center; color: var(--grey-500);
}
.sessions-empty h3 { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink-800); margin: 12px 0 6px; }
.sessions-empty p { font-size: 13.5px; margin: 0 0 20px; }

/* ---------- re-auth modal (401 mid-wizard — never destroys the DOM) ---------- */

.reauth-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(22, 29, 38, .55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.reauth-scrim .auth-card { box-shadow: var(--shadow-xl); }

/* ---------- mobile ---------- */

@media (max-width: 720px) {
  .auth-wrap { padding: 20px 16px; align-items: flex-start; }
  .auth-card { padding: 26px 20px 22px; border-radius: var(--radius-lg); }
  .auth-title { font-size: 22px; }
  .auth-field input { font-size: 16px; } /* avoid iOS focus zoom */

  .sessions-topbar {
    padding: 0 14px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .sessions-topbar .who { margin-left: 0; width: 100%; }
  .sessions-body { padding: 24px 16px 80px; }
  .sessions-title { font-size: 24px; }

  .session-card {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }
  .session-card .s-bar { width: 100%; order: 5; }
  .session-card .auth-btn { width: 100%; }
}
