/* ============================================================
   MistriNow — theme.css (v2 — base + dark mode)
   ============================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
  --sky: #38BDF8;
  --deep: #0284C7;
  --soft: #E0F2FE;
  --white: #FFFFFF;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E5E7EB;
  --bg: #F8FAFC;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --radius: 16px;
  --radius-sm: 12px;
  --pill: 999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 6px 18px rgba(56,189,248,.18);
  --shadow-lg: 0 20px 45px rgba(56,189,248,.22);
  --shadow-sky: 0 12px 30px rgba(56,189,248,.4);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --header-h: 62px;
  --nav-h: 82px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--deep); text-decoration: none; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 13px 22px; border-radius: var(--pill);
  font-weight: 700; font-size: 15px; transition: all .2s ease;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--sky); color: var(--white); box-shadow: var(--shadow-sky); }
.btn-primary:hover { background: var(--deep); }
.btn-ghost { background: var(--soft); color: var(--deep); }
.btn-ghost:hover { background: #BFE7FB; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-lg { padding: 16px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px; border-radius: var(--pill);
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 14px; font-weight: 700; color: var(--ink);
  transition: all .15s ease;
}
.btn-google:hover { background: var(--bg); border-color: #CBD5E1; }

/* ---------- FORMS ---------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white);
  color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--sky); box-shadow: 0 0 0 4px rgba(56,189,248,.18);
}
.phone-group { display: flex; }
.phone-group .prefix {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--bg); border: 1.5px solid var(--line); border-right: none;
  border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm);
  font-weight: 600; color: var(--muted); font-size: 14px;
}
.phone-group input { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

.divider { position: relative; text-align: center; margin: 16px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.divider::before, .divider::after { content: ''; position: absolute; top: 50%; width: 44%; height: 1px; background: var(--line); }
.divider::before { left: 0; }
.divider::after { right: 0; }
.divider span { background: var(--white); padding: 0 12px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 10px 16px; border-radius: var(--pill);
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--ink);
  transition: all .15s ease;
}
.chip.active { background: var(--sky); color: var(--white); border-color: var(--sky); }

.robot-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg);
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all .15s ease; margin-bottom: 14px;
}
.robot-check:hover { border-color: var(--sky); background: var(--soft); }
.robot-check.checked { border-color: var(--success); background: #ECFDF5; color: #065F46; }
.robot-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: transparent; transition: all .15s ease;
}
.robot-check.checked .robot-box { background: var(--success); border-color: var(--success); color: var(--white); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: var(--white);
  padding: 12px 20px; border-radius: var(--pill);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 20px 45px rgba(0,0,0,.15);
  opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.2,.9,.3,1.2);
  z-index: 9999; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--sky); }
.toast.warn { background: var(--warning); }
.toast.error { background: var(--danger); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.text-sky { color: var(--sky); }
.text-deep { color: var(--deep); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.small { font-size: 12px; }

/* ============================================================
   DARK MODE
   ============================================================ */
body.dark {
  --white: #1E293B;
  --ink: #F1F5F9;
  --muted: #94A3B8;
  --line: #334155;
  --bg: #0F172A;
  --bg-soft: #1E293B;
  --soft: #334155;
}

body.dark,
body.dark #phone {
  background: #0F172A;
  color: #F1F5F9;
}

body.dark .app-header,
body.dark .bottom-nav,
body.dark .settings-row,
body.dark .profile-section,
body.dark .job-card,
body.dark .stat,
body.dark .auth-card,
body.dark .modal-card,
body.dark .sheet,
body.dark .mech-card,
body.dark .search-bar,
body.dark .search-results,
body.dark .header-user,
body.dark .profile-btn,
body.dark .profile-menu,
body.dark .pill-user,
body.dark .pill-logo {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

body.dark .field input,
body.dark .field textarea,
body.dark .field select {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

body.dark .phone-group .prefix {
  background: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

body.dark .profile-hero,
body.dark .eta-banner,
body.dark .sent-banner,
body.dark .inline-rating,
body.dark .faq-item,
body.dark .review-item,
body.dark .info-list .row {
  background: #1E293B !important;
  border-color: #334155 !important;
}

body.dark .muted,
body.dark .info-list .row span {
  color: #94A3B8 !important;
}

body.dark .btn-outline { color: #F1F5F9; border-color: #334155; }
body.dark .btn-outline:hover { background: #334155; }

body.dark .switch { background: #334155; }
body.dark .switch.on { background: var(--sky); }

body.dark .leaflet-tile {
  filter: brightness(.75) contrast(1.1) hue-rotate(180deg) invert(1);
}