/* Expense Divider web pages: unified with MSK Developers theme */
:root {
  --accent: hsl(var(--p));
  --accent-ink: hsl(var(--pc));
  --accent-soft: hsl(var(--p) / 0.15);
  --bg: hsl(var(--b1));
  --surface: hsl(var(--b2));
  --surface-2: hsl(var(--b3));
  --text: hsl(var(--bc));
  --muted: hsl(var(--bc) / 0.72);
  --border: hsl(var(--bc) / 0.12);
  --danger: hsl(var(--er, 0 84% 60%));
  --danger-soft: hsl(var(--er, 0 84% 60%) / 0.15);
  --owed: #10b981;
  --owe: #ef4444;
  --radius: 18px;
  --shadow: 0 4px 20px hsl(var(--n) / 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--msk-font-body, system-ui, -apple-system, sans-serif);
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--msk-font-display, var(--msk-font-body)); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.025em; font-weight: 800; }
h2 { font-size: 1.6rem; margin-top: 1.6em; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
main { padding-bottom: 56px; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 9999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-family: var(--msk-font-body); font-weight: 600;
  text-decoration: none; cursor: pointer; transition: transform 0.25s var(--msk-ease), box-shadow 0.25s var(--msk-ease);
}
.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 24px hsl(var(--p) / 0.35);
  transform: translateY(-2px);
  text-decoration: none;
}
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* Isolate and protect unified navbar from global .btn overrides */
#main-nav .btn {
  font: inherit !important;
  background-image: none !important;
  box-shadow: none !important;
  transform: none !important;
}
#main-nav .btn-ghost {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  padding: 0 !important;
  min-height: 2.5rem !important;
  height: 2.5rem !important;
  width: 2.5rem !important;
}
#main-nav .btn-outline {
  background: transparent !important;
  border: 1px solid hsl(var(--bc) / 0.25) !important;
  color: hsl(var(--bc)) !important;
  min-height: 2rem !important;
  height: 2rem !important;
  padding: 0 0.85rem !important;
  font-size: 0.875rem !important;
  border-radius: 9999px !important;
}
#main-nav .btn-outline:hover {
  background: hsl(var(--bc) / 0.1) !important;
  border-color: hsl(var(--bc) / 0.4) !important;
}
#main-nav .btn-primary {
  background: hsl(var(--p)) !important;
  color: hsl(var(--pc)) !important;
  border: none !important;
  min-height: 2rem !important;
  height: 2rem !important;
  padding: 0 1rem !important;
  font-size: 0.875rem !important;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 10px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type=text], select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type=text]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsl(var(--p) / 0.2);
  outline: none;
}
.hint { font-size: .875rem; color: var(--muted); margin-top: 6px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  box-shadow: 0 12px 36px hsl(var(--n) / 0.12);
}
.card + .card { margin-top: 18px; }
.notice { background: var(--surface-2); border-radius: 14px; padding: 14px 18px; border: 1px solid var(--border); }
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid .card + .card { margin-top: 0; }
.icon-badge {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); font-size: 1.45rem; margin-bottom: 14px;
}

/* Landing Hero */
.hero {
  display: grid !important;
  gap: 36px !important;
  grid-template-columns: 1.15fr .85fr !important;
  align-items: center !important;
  place-items: initial !important;
  padding: 48px 0 32px !important;
}
/* Crucial DaisyUI override: prevent hero children from stacking in cell (1, 1) */
.hero > * {
  grid-column-start: auto !important;
  grid-row-start: auto !important;
  max-width: none !important;
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr !important; }
}
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; line-height: 1.6; }
.example { padding: 0; overflow: hidden; border-radius: 20px; box-shadow: 0 16px 40px hsl(var(--n) / 0.14); }
.example-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; background: var(--surface-2); }
.example-head strong { font-size: 1.1rem; }
.example ul { list-style: none; margin: 0; padding: 10px 22px 6px; }
.example li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.example li:last-child { border-bottom: 0; }
.example .owes { padding: 16px 22px 20px; background: var(--surface-2); border-top: 1px solid var(--border); }
.example .owes p { margin: 6px 0; font-size: 0.95rem; }
.amount { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.owed { color: var(--owed); }
.owe { color: var(--owe); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px 18px; box-shadow: var(--shadow); }
.steps li::before {
  content: counter(step); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px;
}

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 20px; margin-bottom: 12px; box-shadow: var(--shadow); transition: background 0.2s; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style-position: outside; }
.faq details p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }

/* Invitation and account */
.panel { max-width: 580px; margin: 32px auto 0; }
.group-mark {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 22px;
  background: var(--accent-soft); font-size: 2.2rem;
}
.person { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rows li:last-child { border-bottom: 0; }
.prose h2 { font-size: 1.35rem; }
.prose li { margin-bottom: 8px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .card { padding: 18px; }
}
