/* style.css — ButlerPass design system.
   Theme: "Spark & Shine" — bright aqua primary, sunshine accents,
   bubbly rounded shapes, Nunito + Bricolage Grotesque type.
   Mobile-first (max-width 960px container, grid at >=720px). */

:root {
  --green: #00a6be;          /* primary aqua */
  --green-dark: #087184;     /* deep aqua */
  --green-soft: #d9f1f6;     /* aqua tint */
  --sun: #ffc53d;            /* sunshine yellow */
  --sun-ink: #4a3200;        /* text on sunshine */
  --bg: #f2fafb;             /* cloud */
  --card: #ffffff;
  --ink: #0e2a35;
  --muted: #5b7a86;
  --line: #dcebee;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --warn-soft: #fef3c7;
  --warn-ink: #92400e;
  --ok-soft: #dcfce7;
  --ok-ink: #166534;
  --star: #ffc53d;
  --radius: 18px;
  --radius-input: 14px;
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Nunito", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(520px 320px at 8% 4%, rgba(0,166,190,.08), transparent 60%),
    radial-gradient(640px 380px at 96% 30%, rgba(255,197,61,.14), transparent 60%),
    linear-gradient(180deg, #f7feff, var(--bg));
  color: var(--ink);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6rem; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--green-dark); }

/* --- Top bar ----------------------------------------------------------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
#topbar .brand {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
#topbar .brand img {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 6px 14px -6px rgba(8,113,132,.4);
}
/* ButlerPass logo on the login/signup card */
.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.35rem;
}
/* ButlerPass full logo on the landing hero */
.hero-logo {
  display: block;
  width: min(280px, 70vw);
  height: auto;
  margin: 0 auto 0.75rem;
}
#mainnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#mainnav a, #mainnav .nav-link-btn {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
#mainnav a:hover, #mainnav .nav-link-btn:hover { background: var(--green-soft); color: var(--green-dark); }
#mainnav .nav-cta {
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1rem;
}
#mainnav .nav-cta:hover { background: var(--green-dark); color: #fff; }
#mainnav .nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.25rem;
}
#mainnav .nav-chip:hover { background: var(--green-soft); }

/* --- Layout ------------------------------------------------------------ */
#view {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4.5rem;
}
.row { display: flex; gap: 0.75rem; align-items: center; }
.grow { flex: 1; min-width: 0; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.mb { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* --- Cards ------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 26px -18px rgba(8,113,132,.35);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* --- Buttons ----------------------------------------------------------- */
button, .btn {
  display: inline-block;
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  border: 0;
  border-radius: var(--radius-input);
  background: var(--green);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--green-dark); color: #fff; transform: translateY(-1px); }
button:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* Sunshine CTA — the Spark & Shine signature button */
.btn-sun {
  background: var(--sun);
  color: var(--sun-ink);
  border-radius: 14px;
  box-shadow: 0 10px 22px -8px rgba(255,197,61,.7);
}
.btn-sun:hover { background: #ffbe22; color: var(--sun-ink); transform: translateY(-2px); }
.btn-ghost, .btn.secondary {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover, .btn.secondary:hover { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.btn-danger, .btn.danger { background: var(--danger); }
.btn-danger:hover, .btn.danger:hover { background: #b42318; }
.btn.block { display: block; width: 100%; margin-top: 0.75rem; }
.btn.small, button.small {
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

/* --- Forms ------------------------------------------------------------- */
label { display: block; font-size: 0.88rem; font-weight: 700; margin: 0.85rem 0 0.35rem; }
input, select, textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
textarea { min-height: 90px; resize: vertical; }
input[type="file"] { padding: 0.5rem; }
input[type="checkbox"] { width: auto; }
.help { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

/* --- Badges / tags ----------------------------------------------------- */
.tag, .badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  white-space: nowrap;
}
.tag.warn, .badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.ok, .badge.ok { background: var(--ok-soft); color: var(--ok-ink); }
.tag.bad, .badge.bad { background: var(--danger-soft); color: var(--danger); }

/* --- Stars / avatars --------------------------------------------------- */
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; font-weight: 700; }
.stars .off { color: #d8d8d2; }
.stars.muted { color: var(--muted); }

.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--green-soft);
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 84px; height: 84px; }
.avatar-xl { width: 110px; height: 110px; }
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  background: var(--green);
  font-size: 1.1rem;
}
.avatar-fallback.avatar-sm { font-size: 0.7rem; }

/* --- Landing hero — Spark & Shine banner -------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2.75rem 1.5rem 2.25rem;
  background:
    radial-gradient(420px 260px at 12% 10%, rgba(0,166,190,.12), transparent 60%),
    radial-gradient(520px 300px at 92% 90%, rgba(255,197,61,.25), transparent 60%),
    linear-gradient(180deg, #f7feff, #ffffff);
  border: 2px solid rgba(0,166,190,.14);
  border-radius: 24px;
  margin-bottom: 1.25rem;
  box-shadow: 0 22px 48px -18px rgba(8,113,132,.25);
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  background: #fff;
  border: 2px solid rgba(0,166,190,.22);
  border-radius: 999px;
  padding: 0.45rem 1rem 0.45rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--green-dark);
  box-shadow: 0 6px 16px -8px rgba(8,113,132,.4);
}
.hero-pill .sun-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--sun);
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
}
.hero h1 { font-size: 2.1rem; margin-bottom: 0.5rem; }
.hero h1 .hl { position: relative; white-space: nowrap; color: var(--green-dark); }
.hero-search {
  max-width: 480px;
  margin: 1.25rem auto 0;
  background: #fff;
  border: 2px solid rgba(0,166,190,.14);
  border-radius: 20px;
  padding: 0.6rem;
  box-shadow: 0 22px 48px -18px rgba(8,113,132,.35);
}
.hero-search input { text-align: center; font-size: 1.05rem; border-color: transparent; background: var(--bg); }
.hero-search input:focus { border-color: var(--green); }
.chip-row { display: flex; gap: 0.5rem; justify-content: center; margin: 0.75rem 0; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  min-height: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.chip:hover { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.chip-active { border-color: var(--green); background: var(--green); color: #fff; }
.chip-active:hover { background: var(--green-dark); color: #fff; }

/* --- How it works ------------------------------------------------------ */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.how-steps li { display: flex; gap: 0.85rem; align-items: flex-start; }
.how-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.how-steps p { margin: 0.25rem 0 0; }

/* --- Wizard ------------------------------------------------------------ */
.steps { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.step { flex: 1; text-align: center; }
.step-dot {
  width: 100%; height: 6px;
  border-radius: 999px;
  background: var(--line);
  margin-bottom: 0.35rem;
}
.step.done .step-dot { background: var(--green); }
.step.current .step-dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.step-label { font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.step.current .step-label { color: var(--green-dark); }
.wizard-nav { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.wizard-nav .btn { flex: 1; }

.opt-grid { display: grid; gap: 0.6rem; }
.opt-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 0;
  color: var(--ink);
}
.opt-card:hover { border-color: var(--green); background: var(--card); color: var(--ink); }
.opt-card.selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.opt-card b { display: block; font-size: 1.02rem; }
.opt-card span { font-size: 0.86rem; color: var(--muted); font-weight: 400; }

.stepper { display: flex; align-items: center; gap: 1rem; }
.stepper button {
  width: 46px; height: 46px;
  min-height: 0; padding: 0;
  border-radius: 50%;
  font-size: 1.4rem; line-height: 1;
  background: var(--card);
  color: var(--green-dark);
  border: 1.5px solid var(--line);
}
.stepper button:hover { border-color: var(--green); background: var(--green-soft); }
.stepper .stepper-val { font-size: 1.4rem; font-weight: 800; min-width: 3ch; text-align: center; }
.stepper-row { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.stepper-row:last-child { border-bottom: 0; }
.stepper-row .lbl b { display: block; }
.stepper-row .lbl span { font-size: 0.85rem; color: var(--muted); }

.pill-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-input);
  padding: 0.7rem 1rem;
  min-height: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}
.pill:hover { border-color: var(--green); background: var(--card); color: var(--ink); }
.pill.selected { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); box-shadow: 0 0 0 1px var(--green); }
.pill small { display: block; font-weight: 400; color: var(--muted); }

.check-card {
  display: flex; align-items: center; gap: 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.6rem;
  background: var(--card);
}
.check-card input { width: 20px; height: 20px; accent-color: var(--green); }
.check-card.checked { border-color: var(--green); background: var(--green-soft); }

/* --- Tasker cards ------------------------------------------------------ */
.sort-tabs { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sort-tab {
  border: 0; background: none; color: var(--muted);
  font-weight: 700; font-size: 0.92rem;
  padding: 0.5rem 0.8rem; min-height: 0; border-radius: 999px;
}
.sort-tab:hover { background: var(--green-soft); color: var(--green-dark); }
.sort-tab.active { background: var(--ink); color: #fff; }
.sort-tab.active:hover { background: var(--ink); }

.tasker-card { transition: box-shadow 0.15s ease; }
.tasker-card:hover { box-shadow: 0 4px 14px rgba(35, 38, 43, 0.08); }
.tasker-card h3 { margin: 0 0 0.15rem; }
.tasker-card .rate { text-align: right; }
.tasker-card .rate strong { display: block; font-size: 1.15rem; }
.tagline { color: var(--muted); font-size: 0.92rem; margin: 0.6rem 0; }
.est { font-weight: 800; color: var(--green-dark); }
.tasker-grid { display: grid; gap: 1rem; }
.mini-card { display: block; color: inherit; text-decoration: none; }
.mini-card:hover { box-shadow: 0 4px 14px rgba(35, 38, 43, 0.08); }
.mini-card .btn { width: 100%; margin-top: 0.75rem; }

/* --- Reviews / photos / slots ------------------------------------------ */
.review { border-top: 1px solid var(--line); padding: 0.85rem 0; }
.review:first-child { border-top: 0; }
.review-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.photo-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.4rem 0; }
.photo-strip img { height: 96px; width: auto; border-radius: 8px; flex-shrink: 0; object-fit: cover; }
.slot { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.slot:last-child { border-bottom: 0; }
.avail-day { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.avail-day:last-child { border-bottom: 0; }

/* --- Price breakdown --------------------------------------------------- */
.price-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.price-table td { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.price-table td:last-child { text-align: right; font-weight: 700; }
.price-table tr.total td { border-bottom: 0; font-size: 1.1rem; color: var(--green-dark); }

/* --- Sticky mobile CTA ------------------------------------------------- */
.sticky-cta {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
  margin: 1.25rem -1rem -4.5rem;
  display: flex; gap: 0.75rem; align-items: center;
  box-shadow: 0 -2px 10px rgba(35, 38, 43, 0.06);
}
.sticky-cta .btn { flex: 1; margin-top: 0; }

/* --- Chat bubbles (used by task views) --------------------------------- */
.msg-row { display: flex; margin: 0.35rem 0; }
.msg-row.msg-me { justify-content: flex-end; }
.msg-row.msg-them { justify-content: flex-start; }
.msg-row > * {
  max-width: 78%;
  padding: 0.55rem 0.85rem;
  border-radius: 16px;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.msg-row.msg-me > * { background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.msg-them > * { background: #ececea; color: var(--ink); border-bottom-left-radius: 4px; }
.msg-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }

/* --- Tables ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--card); }
.table th, .table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* --- Lists ------------------------------------------------------------- */
.list-item { display: flex; gap: 0.8rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.list-item:last-child { border-bottom: 0; }

/* --- Toast -------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%; bottom: 1.2rem;
  transform: translateX(-50%) translateY(200%);
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-input);
  transition: transform 0.25s ease;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
  font-weight: 600;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* --- Responsive ---------------------------------------------------------- */
@media (min-width: 720px) {
  #view { padding: 2rem 1.5rem 4.5rem; }
  .hero h1 { font-size: 2.4rem; }
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  .how-steps li { flex-direction: column; }
  .tasker-grid { grid-template-columns: repeat(2, 1fr); }
  .opt-grid.cols2 { grid-template-columns: repeat(2, 1fr); }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
}

/* Language toggle: compact 中文/EN segmented switch in the global header. */
.lang-toggle {
  display: inline-flex;
  background: var(--bg, #f1f5f9);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted, #64748b);
  line-height: 1.2;
}
.lang-toggle button.active {
  background: #fff;
  color: var(--ink, #0f172a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  font-weight: 700;
}
