/* ============================================================
   abinci.food — Shared Design Tokens
   Import this in every app: <link rel="stylesheet" href="../shared/css/tokens.css">
   ============================================================ */

:root {
  /* Colours */
  --bg:       #0f0e0c;
  --surface:  #1a1916;
  --surface2: #242220;
  --border:   #2e2c29;
  --accent:   #f5a623;
  --accent2:  #e8603c;
  --text:     #f0ede8;
  --muted:    #8a8680;
  --green:    #4caf7d;
  --red:      #e05c5c;
  --blue:     #5b9cf6;

  /* Typography */
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* App max-width */
  --app-width: 430px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: var(--app-width);
  margin: 0 auto;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, h4, h5 { font-family: var(--font-head); }

/* ── Screen System ── */
.screen { display: none; min-height: 100vh; padding-bottom: 80px; animation: fadeIn .2s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-width);
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 100;
}
.nav-item {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 3px; cursor: pointer;
  padding: 4px 16px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 11px; transition: color .2s;
}
.nav-item.active { color: var(--accent); }
.nav-item svg { width: 22px; height: 22px; }

/* ── Topbar ── */
.topbar {
  padding: 20px 20px 12px; display: flex;
  align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50; background: var(--bg);
}
.topbar-logo { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.topbar-logo span { color: var(--accent); }

/* ── Common Components ── */
.avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.back-btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: rgba(15,14,12,.7); border: 1px solid var(--border);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.big-btn {
  width: 100%; background: var(--accent); color: #000; border: none;
  border-radius: var(--radius-lg); padding: 16px; font-size: 16px;
  font-weight: 700; font-family: var(--font-head); cursor: pointer;
  margin-top: 20px; transition: opacity .2s;
}
.big-btn:disabled { opacity: .35; cursor: default; }
.big-btn:not(:disabled):hover { opacity: .85; }

.form-group { margin-bottom: 18px; }
.form-label {
  font-size: 12px; color: var(--muted); font-weight: 500;
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; display: block;
}
.form-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px; color: var(--text);
  font-size: 14px; font-family: var(--font-body); outline: none; transition: border .2s;
}
.form-input:focus { border-color: var(--accent); }
.form-select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px; color: var(--text);
  font-size: 14px; font-family: var(--font-body); outline: none; appearance: none;
}
.form-select option { background: var(--surface2); color: var(--text); }
.char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-label { font-size: 16px; font-weight: 700; margin-bottom: 12px; font-family: var(--font-head); }

.menu-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.menu-row-left { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  width: 100%; max-width: var(--app-width);
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-family: var(--font-head); font-size: 20px; font-weight: 800; margin-bottom: 20px; }

/* Toast */
#app-toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px 20px; border-radius: var(--radius-md); font-size: 13px;
  z-index: 9999; max-width: 320px; text-align: center;
  transition: opacity .3s; pointer-events: none; opacity: 0;
}

/* Badges */
.badge-verified {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(76,175,125,.12); color: var(--green);
  border: 1px solid rgba(76,175,125,.25);
  border-radius: var(--radius-full); padding: 3px 10px; font-size: 11px; font-weight: 600;
}
.badge-pending {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,166,35,.12); color: var(--accent);
  border: 1px solid rgba(245,166,35,.25);
  border-radius: var(--radius-full); padding: 3px 10px; font-size: 11px; font-weight: 600;
}
.availability-badge { padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 600; }
.available { background: rgba(76,175,125,.2); color: var(--green); border: 1px solid rgba(76,175,125,.3); }
.unavailable { background: rgba(224,92,92,.15); color: var(--red); border: 1px solid rgba(224,92,92,.2); }

/* Toggle */
.toggle {
  width: 52px; height: 28px; background: var(--border);
  border-radius: var(--radius-full); position: relative; cursor: pointer; transition: background .3s; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .3s;
}
.toggle.on { background: var(--green); }
.toggle.on::after { left: 27px; }

/* Notification dot */
.notif-dot {
  position: absolute; top: 0; right: 0; width: 8px; height: 8px;
  background: var(--red); border-radius: 50%; display: none;
}
.notif-dot.show { display: block; }

/* Upload zones */
.img-upload-zone {
  width: 100%; border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 24px 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
  background: var(--surface2);
}
.img-upload-zone:hover { border-color: var(--accent); background: rgba(245,166,35,.04); }
.img-upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.img-upload-zone.has-image { border-style: solid; border-color: var(--accent); padding: 0; }
.img-upload-zone.has-image img { width: 100%; height: 160px; object-fit: cover; display: block; border-radius: var(--radius-lg); }

/* Realtime pulse */
.realtime-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  display: inline-block; margin-right: 4px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Earnings card */
.earnings-card {
  background: linear-gradient(135deg, #1e1508, #2e1f0a);
  border: 1px solid #3a2a10; border-radius: var(--radius-xl);
  padding: 24px 20px; margin: 0 20px 16px; text-align: center;
}
.earnings-amount { font-size: 36px; font-weight: 800; font-family: var(--font-head); color: var(--accent); }

/* Info badge */
.info-badge {
  background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.2);
  border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px;
  color: var(--muted); margin-bottom: 16px; display: flex; gap: 10px;
}
