/* ═══════════════════════════════════════════════════════════════
   SEATFLOW  —  styles.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Design tokens ────────────────────────────────────────────── */
:root {
  --bg:      #0a0c14;
  --surface: #12151f;
  --high:    #1a1e2e;
  --border:  #252a3d;
  --accent:  #4f6ef7;
  --purple:  #7c3aed;
  --green:   #22c55e;
  --warn:    #f59e0b;
  --red:     #ef4444;
  --muted:   #4a5068;
  --text:    #e8eaf6;
  --dim:     #8b91b0;

  /* Safe area insets (notch / home bar) */
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
  --sar: env(safe-area-inset-right);
}

/* ── Layout ───────────────────────────────────────────────────── */
html, body, #app {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

body {
  padding-top:    var(--sat);
  padding-bottom: var(--sab);
  padding-left:   var(--sal);
  padding-right:  var(--sar);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Typography ───────────────────────────────────────────────── */
button          { font-family: 'DM Mono', monospace; cursor: pointer; }
input, select,
textarea        { font-family: 'DM Mono', monospace; }

/* ── Scrollbars ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin    { to { transform: rotate(360deg); } }

.fade-in  { animation: fadeIn  .25s ease forwards; }
.slide-up { animation: slideUp .3s  ease forwards; }
.pulse    { animation: pulse   1.5s ease infinite; }
.spin     { animation: spin    .8s  linear infinite; display: inline-block; }

/* ── Drag ─────────────────────────────────────────────────────── */
[draggable=true]        { cursor: grab; }
[draggable=true]:active { cursor: grabbing; }

/* ── OTP input row ────────────────────────────────────────────── */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-row input {
  width: 42px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--high);
  border: 2px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.otp-row input:focus { border-color: var(--accent); }

/* ── QR code wrapper ──────────────────────────────────────────── */
.qr-wrap {
  background: white;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
}

/* ── Password strength bar ────────────────────────────────────── */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  transition: width .3s, background .3s;
}

/* ── Auth page wrapper ────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
}

.auth-card {
  width: 400px;
  max-width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .icon    { font-size: 48px; margin-bottom: 10px; filter: drop-shadow(0 0 20px #4f6ef755); }
.auth-logo h1       { font-size: 26px; color: var(--text); font-weight: 700; letter-spacing: -.03em; }
.auth-logo .tagline { color: var(--dim); font-size: 11px; margin-top: 5px; }

.auth-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 60px rgba(0,0,0,.4);
}

/* ── Tab bar ──────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.tab-bar button {
  flex: 1;
  padding: 9px 0;
  border: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  transition: all .2s;
  color: var(--dim);
  background: transparent;
}

.tab-bar button.active {
  background: var(--accent);
  color: #fff;
}

/* ── Home dashboard ───────────────────────────────────────────── */
.home-page {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.home-body {
  flex: 1;
  padding: 24px 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.chart-card {
  background: var(--high);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chart-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--high));
}

/* ── Chart screen ─────────────────────────────────────────────── */
.chart-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 10px;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: 270px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Seat grid ────────────────────────────────────────────────── */
.seat {
  width: 34px;
  height: 36px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  border-width: 2px;
  border-style: solid;
}

.seat:hover { transform: scale(1.1); }

/* ── Modal overlay ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
}

/* ── Toast ────────────────────────────────────────────────────── */
.sf-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 3000;
  white-space: nowrap;
  pointer-events: none;
  color: #fff;
}

/* ── Form elements ────────────────────────────────────────────── */
.sf-input {
  background: var(--high);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'DM Mono', monospace;
  transition: border-color .15s;
}

.sf-input:focus { border-color: var(--accent); }

.sf-label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .05em;
  margin-bottom: 6px;
  display: block;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.sf-btn {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
}

.sf-btn:disabled { opacity: .5; cursor: not-allowed; }

.sf-btn-primary   { background: var(--accent);  color: #fff;        border: none; }
.sf-btn-secondary { background: var(--high);    color: var(--text); border: 1px solid var(--border); }
.sf-btn-danger    { background: var(--red);     color: #fff;        border: none; }
.sf-btn-ghost     { background: transparent;    color: var(--dim);  border: 1px solid var(--border); }
.sf-btn-success   { background: var(--green);   color: #fff;        border: none; }
.sf-btn-warn      { background: var(--warn);    color: #000;        border: none; }

.sf-btn-primary:hover   { filter: brightness(1.1); }
.sf-btn-secondary:hover { background: var(--border); }
.sf-btn-ghost:hover     { background: var(--high); color: var(--text); }
.sf-btn-danger:hover    { filter: brightness(1.1); }
.sf-btn-success:hover   { filter: brightness(1.1); }

/* ── Badge ────────────────────────────────────────────────────── */
.sf-badge {
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
}

/* ── Divider ──────────────────────────────────────────────────── */
.sf-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.sf-divider-line { flex: 1; height: 1px; background: var(--border); }
.sf-divider-text { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ── Placing banner ───────────────────────────────────────────── */
.placing-banner {
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  border: 1px solid var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── iOS install banner ───────────────────────────────────────── */
.ios-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 500;
}

/* ── PWA install bar ──────────────────────────────────────────── */
.pwa-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 500;
  gap: 10px;
}

/* ── Account avatar ───────────────────────────────────────────── */
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
  border-width: 2px;
}
