/* ================================================================
   I Did My Chores — Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --bg:        #090909;
  --surface:   #141414;
  --card:      #1c1c1c;
  --card2:     #222222;
  --border:    #2a2a2a;
  --text:      #f0ede8;
  --muted:     #666;
  --muted2:    #444;
  --gold:      #f5c842;
  --gold-dim:  rgba(245,200,66,0.12);
  --green:     #34d399;
  --green-dim: rgba(52,211,153,0.1);
  --red:       #f87171;
  --red-dim:   rgba(248,113,113,0.1);
  --blue:      #60a5fa;
  --blue-dim:  rgba(96,165,250,0.1);
  --pink:      #f472b6;
  --pink-dim:  rgba(244,114,182,0.1);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

html { font-size: 16px; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Screens ── */
.screen {
  display: none;
  min-height: 100vh;
  padding: 32px 20px 48px;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ── */
.page-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  font-weight: 700;
}

p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.mono {
  font-family: 'DM Mono', monospace;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.card + .card { margin-top: 10px; }

/* ── Form elements ── */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--gold);
}

.field input::placeholder { color: var(--muted2); }

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field select option { background: var(--surface); }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }

.toggle-label { font-size: 14px; font-weight: 600; }
.toggle-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }

.toggle {
  width: 44px; height: 26px;
  background: var(--border);
  border-radius: 99px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--gold); }
.toggle::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(18px); }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--gold); color: #000; }
.btn-secondary { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.btn-danger   { background: var(--red-dim); border: 1px solid rgba(248,113,113,0.25); color: var(--red); }
.btn-ghost    { background: transparent; color: var(--muted); padding: 10px 20px; }
.btn-google   {
  background: #fff; color: #111;
  border: 1px solid #ddd;
}
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; border-radius: var(--radius-sm); }

/* ── Divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; margin: 16px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Section header ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 10px;
}

/* ── List items ── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

.list-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}

.list-info  { flex: 1; min-width: 0; }
.list-name  { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-right { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* ── Tags ── */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.tag-gold   { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(245,200,66,0.2);  }
.tag-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(52,211,153,0.2);  }
.tag-red    { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }
.tag-blue   { background: var(--blue-dim);  color: var(--blue);  border: 1px solid rgba(96,165,250,0.2);  }
.tag-muted  { background: var(--card2);     color: var(--muted); border: 1px solid var(--border);         }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 10px 0 20px;
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 6px 0;
  background: none; border: none;
  cursor: pointer; color: var(--muted);
  font-family: inherit; font-size: 10px;
  font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-item.active { color: var(--gold); }
.nav-icon { font-size: 20px; line-height: 1; }

/* ── Modal sheet ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-sheet {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 44px;
  border: 1px solid var(--border);
  border-bottom: none;
  animation: slideUp 0.25s cubic-bezier(0.34,1.2,0.64,1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 auto 20px;
}

/* ── Toast ── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: transform 0.3s ease;
  z-index: 200;
  pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Loading ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 32px;
  color: var(--muted); font-size: 13px;
}

/* ── PIN input ── */
.pin-row {
  display: flex; gap: 10px; justify-content: center;
  margin: 24px 0;
}
.pin-digit {
  width: 52px; height: 60px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 24px; font-weight: 700;
  text-align: center; color: var(--text);
  font-family: 'DM Mono', monospace;
  outline: none;
  transition: border-color 0.15s;
}
.pin-digit:focus { border-color: var(--gold); }

/* ── Balance bar ── */
.balance-bar {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.balance-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), #fb923c);
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Color pickers ── */
.color-picker {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 8px;
}
.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.15s;
}
.color-swatch.selected { border-color: #fff; transform: scale(1.15); }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ── Approval card ── */
.approval-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
}
.approval-photo {
  width: 100%; height: 180px;
  object-fit: cover;
  background: var(--card2);
  display: flex; align-items: center;
  justify-content: center;
  color: var(--muted); font-size: 32px;
}
.approval-body { padding: 14px; }
.approval-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Responsive helpers ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-gold  { color: var(--gold); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-muted { color: var(--muted); }
