/* ============================================================================
 *  Restock auth + settings + walkthrough styles. Loaded after restock.css.
 * ========================================================================== */

/* ── shared centered auth shell ─────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: stretch; justify-content: stretch;
  background: var(--bg);
}
.auth-shell__art {
  display: none; flex: 1 1 0; position: relative;
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 65%, #000), color-mix(in srgb, var(--brand) 22%, var(--bg)));
  color: white; padding: 48px;
  overflow: hidden;
}
@media (min-width: 1024px) { .auth-shell__art { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-shell__art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 80% 20%, color-mix(in srgb, var(--brand-2) 40%, transparent), transparent 60%);
  opacity: .35; pointer-events: none;
}
.auth-shell__brandmark { position: relative; display: flex; align-items: center; gap: 12px; font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.auth-shell__sell { position: relative; max-width: 420px; }
.auth-shell__sell h2 { font-size: 28px; font-weight: 800; line-height: 1.15; margin-bottom: 12px; }
.auth-shell__sell p  { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.85); }
.auth-shell__stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.auth-shell__stat { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 14px; }
.auth-shell__stat-num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-shell__stat-lbl { font-size: 11px; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

.auth-shell__form-wrap {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%; min-width: 0; max-width: 440px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px;
}
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-card p.muted { font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.auth-form input, .auth-form select, .auth-form textarea {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.auth-form .row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.auth-form .check { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.auth-form .check input { width: 16px; height: 16px; accent-color: var(--brand); }
.auth-form .submit {
  background: var(--brand); color: white; border: none; border-radius: 10px;
  padding: 12px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .12s, transform .12s;
}
.auth-form .submit:hover { filter: brightness(1.06); }
.auth-form .submit:active { transform: scale(.99); }
.auth-form .submit:disabled { opacity: .55; cursor: not-allowed; }
.auth-form .err {
  background: color-mix(in srgb, #dc2626 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #dc2626 35%, var(--border));
  color: #fecaca; padding: 10px 12px; border-radius: 10px; font-size: 13px;
}
.auth-form .ok {
  background: color-mix(in srgb, #10b981 14%, var(--surface));
  border: 1px solid color-mix(in srgb, #10b981 35%, var(--border));
  color: #bbf7d0; padding: 10px 12px; border-radius: 10px; font-size: 13px;
}
.auth-form .ghost-link { background: transparent; border: none; color: var(--brand); cursor: pointer; padding: 0; font-size: 13px; font-weight: 500; }
.auth-card__footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); text-align: center; }
.auth-card__footer a { color: var(--brand); text-decoration: none; font-weight: 500; }

/* ── demo banner ─────────────────────────────────────────────────────────── */
.restock-demo-banner {
  position: sticky; top: 0; z-index: 80;
  width: 100%; height: 32px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: color-mix(in srgb, var(--text-muted) 14%, var(--surface));
  border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; padding: 0 12px;
}
.restock-demo-banner strong { color: var(--text); font-weight: 600; }
.restock-demo-banner--unlocked {
  background: linear-gradient(90deg, color-mix(in srgb, #f59e0b 14%, var(--surface)), color-mix(in srgb, #f59e0b 8%, var(--surface)));
  border-bottom-color: color-mix(in srgb, #f59e0b 35%, var(--border));
  color: var(--text);
}
.restock-demo-banner--unlocked strong { color: #fbbf24; }
.restock-demo-banner a { color: inherit; }
.restock-demo-banner__close {
  background: transparent; border: none; color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 0 6px; line-height: 1;
}
.restock-demo-banner__close:hover { color: var(--text); }

/* ── onboarding wizard ───────────────────────────────────────────────────── */
.onb-shell { min-height: 100vh; min-height: 100dvh; background: var(--bg); padding: 32px 20px; }
.onb-container { max-width: 720px; margin: 0 auto; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.onb-progress__step { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); transition: background .25s; }
.onb-progress__step.is-done    { background: var(--brand); }
.onb-progress__step.is-current { background: color-mix(in srgb, var(--brand) 65%, var(--surface-2)); }
.onb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.onb-card__eyebrow { font-size: 12px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.onb-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.onb-card p.muted { font-size: 14px; line-height: 1.55; }
.onb-grid { display: grid; gap: 12px; margin-top: 22px; }
@media (min-width: 600px) { .onb-grid { grid-template-columns: 1fr 1fr; } }
.onb-choice {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: border-color .12s, transform .08s;
}
.onb-choice:hover  { border-color: var(--brand); }
.onb-choice:active { transform: scale(.99); }
.onb-choice.is-selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }
.onb-choice__icon { font-size: 22px; margin-bottom: 6px; }
.onb-choice__title { font-weight: 600; font-size: 14px; }
.onb-choice__body  { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.onb-actions { display: flex; justify-content: space-between; margin-top: 28px; }
.onb-actions .btn { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 14px; font-weight: 500; }
.onb-actions .btn:hover { border-color: var(--brand); }
.onb-actions .btn-primary { background: var(--brand); color: white; border-color: var(--brand); }

/* ── settings ────────────────────────────────────────────────────────────── */
.settings-shell { display: grid; gap: 24px; }
@media (min-width: 900px) { .settings-shell { grid-template-columns: 220px 1fr; } }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; font-size: 14px;
  color: var(--text-muted); text-decoration: none;
}
.settings-nav a:hover  { background: var(--surface-2); color: var(--text); }
.settings-nav a.active { background: color-mix(in srgb, var(--brand) 15%, var(--surface)); color: var(--brand); font-weight: 600; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 16px; }
.settings-section h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.settings-section p.muted { font-size: 13px; margin-bottom: 18px; }
.settings-field { display: grid; gap: 14px; }
@media (min-width: 600px) { .settings-field.cols-2 { grid-template-columns: 1fr 1fr; } }
.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--border);
}
.settings-row:first-child { border-top: 0; padding-top: 4px; }
.settings-row__title { font-weight: 600; font-size: 14px; }
.settings-row__body  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle {
  appearance: none; width: 38px; height: 22px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px;
  position: relative; cursor: pointer; transition: background .15s;
}
.toggle::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: var(--text); border-radius: 50%; transition: transform .15s;
}
.toggle:checked { background: var(--brand); border-color: var(--brand); }
.toggle:checked::before { transform: translateX(16px); background: white; }
.danger-zone {
  border: 1px dashed color-mix(in srgb, #dc2626 35%, var(--border));
  background: color-mix(in srgb, #dc2626 8%, var(--surface));
  border-radius: 14px; padding: 18px;
}
.danger-zone h3 { color: #f87171; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.btn-danger { background: #dc2626; color: white; border: none; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { filter: brightness(1.1); }

/* ── modal (used by mock Stripe checkout, confirm dialogs, CRUD forms) ──── */
.restock-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.restock-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  max-width: 480px; width: 100%; max-height: 92vh; overflow: auto;
  animation: slideUp .22s ease-out;
}
.restock-modal--wide { max-width: 680px; }
.restock-modal__hd { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.restock-modal__hd h3 { font-size: 16px; font-weight: 700; }
.restock-modal__close { background: transparent; border: none; font-size: 22px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.restock-modal__bd { padding: 22px; }
.restock-modal__ft { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* swipe-down dismiss bar on mobile */
@media (max-width: 767px) {
  .restock-modal { border-radius: 18px 18px 0 0; align-self: flex-end; max-height: 90vh; }
  .restock-modal-backdrop { align-items: flex-end; padding: 0; }
  .restock-modal::before {
    content: ""; display: block; width: 40px; height: 4px; border-radius: 2px;
    background: var(--border); margin: 8px auto 0;
  }
}

/* ── walkthrough tour ───────────────────────────────────────────────────── */
.restock-tour-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0,0,0,.55);
  animation: fadeIn .2s ease-out;
}
.restock-tour-tip {
  position: absolute; max-width: 320px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.restock-tour-step  { font-size: 11px; color: var(--brand); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.restock-tour-title { font-size: 16px; font-weight: 700; margin-top: 4px; }
.restock-tour-body  { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.restock-tour-actions { display: flex; justify-content: space-between; margin-top: 14px; gap: 8px; }
.restock-tour-skip { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; }
.restock-tour-next { background: var(--brand); color: white; border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── CRUD list rows / empty states / pull-to-refresh ─────────────────────── */
.list-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  transition: border-color .12s, transform .08s;
}
.list-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { font-weight: 600; font-size: 14px; }
.list-row__sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-row__act { display: flex; gap: 6px; }
.iconbtn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.iconbtn:hover { color: var(--text); border-color: var(--brand); }
.iconbtn--danger:hover { color: #f87171; border-color: #dc2626; }

.empty-state {
  border: 1px dashed var(--border); border-radius: 14px;
  padding: 36px 20px; text-align: center;
}
.empty-state__icon { font-size: 32px; margin-bottom: 8px; opacity: .6; }
.empty-state__title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-state__body  { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.ptr {
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden; transition: height .2s;
  font-size: 12px; color: var(--text-muted);
}
.ptr.is-visible { height: 36px; }
.ptr.is-spinning::before {
  content: ""; width: 14px; height: 14px; border: 2px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ── PWA install prompt ─────────────────────────────────────────────────── */
.pwa-prompt {
  position: fixed; bottom: 80px; left: 16px; right: 16px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: slideUp .25s ease-out;
}
@media (min-width: 768px) { .pwa-prompt { left: auto; right: 24px; max-width: 360px; bottom: 24px; } }
.pwa-prompt__icon { font-size: 28px; }
.pwa-prompt__body { flex: 1; }
.pwa-prompt__title { font-size: 14px; font-weight: 600; }
.pwa-prompt__sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.pwa-prompt__btn   { background: var(--brand); color: white; border: none; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.pwa-prompt__dismiss { background: transparent; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

/* topbar logout + tour-trigger affordances */
.topbar-actions { display: inline-flex; align-items: center; gap: 6px; }
.topbar-actions .iconbtn { width: 30px; height: 30px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12px; cursor: pointer;
}
.user-chip__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: white; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}

/* button press feedback for touch */
.btn, .iconbtn, .tenant-tile, .onb-choice, .list-row, .submit, .btn-primary { -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.98); }
