/* ═══════════════════════════════════════════
   DARAJA — Global Design System
   ═══════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── Screen System ────────────────────────── */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #FDF3EA;
  animation: screenIn 0.22s ease-out;
}

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

/* ── Top Navigation Bar ───────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #FDF3EA;
  border-bottom: 1px solid #E8D5C4;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #F0E4D8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.topbar-back:active { background: #E8D5C4; }

.topbar-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: #1C0F05;
  flex: 1;
}

.topbar-logo {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: #C84B11;
  letter-spacing: -0.5px;
}

/* ── Bottom Navigation ────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: white;
  border-top: 1px solid #E8D5C4;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(28,15,5,0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s;
  color: #8C6A52;
  font-size: 10px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
  color: #C84B11;
}

.bottom-nav-item .nav-icon {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active .nav-icon {
  stroke: #C84B11;
}

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary {
  background: #C84B11;
  color: white;
  box-shadow: 0 4px 16px rgba(200,75,17,0.30);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(200,75,17,0.40); }

.btn-secondary {
  background: #F0E4D8;
  color: #1C0F05;
}

.btn-secondary:hover { background: #E8D5C4; }

.btn-outline {
  background: transparent;
  color: #C84B11;
  border: 2px solid #C84B11;
}

.btn-ghost {
  background: transparent;
  color: #8C6A52;
  padding: 10px 16px;
}

.btn-danger {
  background: #DC2626;
  color: white;
}

.btn-success {
  background: #1E6B45;
  color: white;
  box-shadow: 0 4px 16px rgba(30,107,69,0.25);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-lg {
  padding: 17px 32px;
  font-size: 17px;
  border-radius: 16px;
}

/* ── Cards ────────────────────────────────── */
.card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #E8D5C4;
  box-shadow: 0 1px 4px rgba(28,15,5,0.04);
}

.card-pressable {
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.card-pressable:active {
  transform: scale(0.985);
  box-shadow: 0 1px 2px rgba(28,15,5,0.06);
}

/* ── Form Elements ────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: #8C6A52;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.field-input {
  background: white;
  border: 1.5px solid #E8D5C4;
  border-radius: 12px;
  padding: 13px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #1C0F05;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  outline: none;
  border-color: #C84B11;
  box-shadow: 0 0 0 3px rgba(200,75,17,0.12);
}

.field-input::placeholder { color: #C4A98E; }

.field-input.error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.10);
}

.field-error {
  font-size: 12px;
  color: #DC2626;
  font-weight: 500;
}

.field-hint {
  font-size: 12px;
  color: #8C6A52;
}

textarea.field-input {
  resize: none;
  min-height: 100px;
}

select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238C6A52' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Badges ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
}

.badge-orange  { background: #FEE8D8; color: #C84B11; }
.badge-green   { background: #D1FAE5; color: #1E6B45; }
.badge-gray    { background: #F0E4D8; color: #8C6A52; }
.badge-red     { background: #FEE2E2; color: #DC2626; }
.badge-blue    { background: #DBEAFE; color: #1D4ED8; }
.badge-yellow  { background: #FEF3C7; color: #92400E; }

/* ── Stars ────────────────────────────────── */
.stars {
  display: inline-flex;
  gap: 2px;
  color: #F59E0B;
}

/* ── List items ───────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #F0E4D8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.list-item:last-child { border-bottom: none; }

.list-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #F0E4D8;
}

/* ── Section headers ──────────────────────── */
.section-header {
  padding: 20px 16px 8px;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: #1C0F05;
  line-height: 1.2;
}

.section-sub {
  font-size: 14px;
  color: #8C6A52;
  margin-top: 4px;
  font-weight: 400;
}

/* ── Pill tabs ────────────────────────────── */
.pill-tabs {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pill-tabs::-webkit-scrollbar { display: none; }

.pill-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: #F0E4D8;
  color: #8C6A52;
  border: none;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.pill-tab.active {
  background: #C84B11;
  color: white;
  box-shadow: 0 2px 8px rgba(200,75,17,0.25);
}

/* ── Stat cards ───────────────────────────── */
.stat-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #E8D5C4;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 700;
  color: #1C0F05;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: #8C6A52;
  font-weight: 500;
}

/* ── Dividers ─────────────────────────────── */
.divider {
  height: 1px;
  background: #E8D5C4;
  margin: 0 16px;
}

.divider-full {
  height: 8px;
  background: #F0E4D8;
  margin: 8px 0;
}

/* ── Empty states ─────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: #F0E4D8;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: #1C0F05;
}

.empty-text {
  font-size: 14px;
  color: #8C6A52;
  max-width: 240px;
  line-height: 1.5;
}

/* ── Toast ────────────────────────────────── */
.toast {
  background: #1C0F05;
  color: white;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease-out;
  box-shadow: 0 8px 24px rgba(28,15,5,0.25);
  font-family: 'DM Sans', sans-serif;
}

.toast.success { background: #1E6B45; }
.toast.error   { background: #DC2626; }
.toast.info    { background: #1D4ED8; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

/* ── Loader ───────────────────────────────── */
.loader {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(200,75,17,0.2);
  border-top-color: #C84B11;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loader-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

.loader-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

/* ── Splash ───────────────────────────────── */
.splash-dots {
  display: flex;
  gap: 6px;
}

.splash-dots span {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0.4;
  animation: pulse 1.2s ease-in-out infinite;
}

.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.3); }
}

/* ── Blurred lead card (marketplace) ─────── */
.blurred-field {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  border-radius: 6px;
  background: #F0E4D8;
  display: inline-block;
}

/* ── Progress steps ───────────────────────── */
.steps {
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F0E4D8;
  border: 2px solid #E8D5C4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #8C6A52;
  z-index: 1;
  font-family: 'DM Sans', sans-serif;
}

.step.active  .step-dot { background: #C84B11; border-color: #C84B11; color: white; }
.step.done    .step-dot { background: #1E6B45; border-color: #1E6B45; color: white; }

.step-line {
  position: absolute;
  top: 14px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: #E8D5C4;
  z-index: 0;
}

.step.done .step-line { background: #1E6B45; }

.step-label {
  font-size: 10px;
  color: #8C6A52;
  font-weight: 600;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
}

.step.active .step-label { color: #C84B11; }
.step.done   .step-label { color: #1E6B45; }

/* ── OTP / verification input ─────────────── */
.otp-input {
  width: 100%;
  background: #F0E4D8;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #1C0F05;
  transition: border-color 0.15s;
}

.otp-input:focus {
  outline: none;
  border-color: #C84B11;
  background: white;
}

/* ── Hero ─────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #C84B11 0%, #A33A0A 100%);
  padding: 32px 20px 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  font-family: 'DM Sans', sans-serif;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  font-weight: 400;
}

/* ── Ticket card ──────────────────────────── */
.ticket-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #E8D5C4;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(28,15,5,0.04);
}

.ticket-card-header {
  background: #F0E4D8;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-card-body {
  padding: 16px;
}

/* ── Rating stars interactive ─────────────── */
.rating-stars {
  display: flex;
  gap: 8px;
}

.rating-star {
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: transform 0.1s;
  color: #E8D5C4;
  -webkit-tap-highlight-color: transparent;
}

.rating-star.filled { color: #F59E0B; }
.rating-star:active  { transform: scale(1.2); }

/* ── Content padding for bottom nav ──────── */
.content-with-nav {
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* ── Auth screen ──────────────────────────── */
.auth-screen {
  min-height: 100dvh;
  background: linear-gradient(160deg, #C84B11 0%, #7A2A06 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.auth-card {
  background: white;
  border-radius: 28px;
  padding: 28px 24px;
  width: 100%;
  max-width: 400px;
}

/* ── Scrollable content ───────────────────── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Floating action button ───────────────── */
.fab {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #C84B11;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(200,75,17,0.40);
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 30;
  -webkit-tap-highlight-color: transparent;
}

.fab:active {
  transform: scale(0.93);
  box-shadow: 0 3px 12px rgba(200,75,17,0.30);
}

/* ── Search bar ───────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1.5px solid #E8D5C4;
  border-radius: 14px;
  padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar:focus-within {
  border-color: #C84B11;
  box-shadow: 0 0 0 3px rgba(200,75,17,0.10);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #1C0F05;
  background: transparent;
}

.search-bar input::placeholder { color: #C4A98E; }

/* ── Ripple / selection list ──────────────── */
.select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #F0E4D8;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.select-item:last-child { border-bottom: none; }
.select-item:active { background: #FEF3EA; }

/* ── Responsive max-width container ──────── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Utility: scrollbar hide ──────────────── */
.no-scroll::-webkit-scrollbar { display: none; }
.no-scroll { scrollbar-width: none; -ms-overflow-style: none; }
