/*
 * The public face: landing page, sign-in, and the shop list.
 *
 * Deliberately its own stylesheet rather than the dashboard's. The dashboard
 * is a dense working tool and this is the first thing a stranger sees; sharing
 * one file would mean every change to one risking the other. They share the
 * same variables by being written to the same values, which is a small
 * duplication against a large coupling.
 *
 * Nothing here is imported from Kabayan Europe: no header, no navigation, no
 * branding, no fonts fetched from a third party. The store builder is a
 * separate product and a test asserts the dashboard and storefront say so.
 */

:root {
  --ink: #16181d;
  --ink-soft: #5a6069;
  --line: #e2e5ea;
  --paper: #ffffff;
  --sand: #f7f7f5;
  --brand: #1f6feb;
  --brand-dark: #1a5fd0;
  --good: #166534;
  --good-bg: #eaf6ee;
  --bad: #9f1239;
  --bad-bg: #fdf0f3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- header */

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  font-weight: 650;
}

.brand-mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), #4f9cff);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.navlink {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: 7px;
  font-weight: 550;
}
.navlink:hover { background: var(--sand); color: var(--ink); }
.navlink.is-current { color: var(--brand); background: #eef4ff; }

.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ main */

.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.main-wide { max-width: 1040px; }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 0.6rem; letter-spacing: -0.015em; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); }

.lede { font-size: 1.1rem; color: var(--ink-soft); }
.subtle { color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 0.875rem; margin: 0.4rem 0 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; }
.optional { color: var(--ink-soft); font-weight: 400; font-size: 0.85rem; }
.right { text-align: right; }

.page-head { margin-bottom: 1.5rem; }
.narrow { max-width: 420px; margin: 0 auto; }

/* ------------------------------------------------------------------ hero */

.hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
}
.hero h1 { font-size: 2.4rem; }
.hero .lede { max-width: 34rem; margin: 0 auto 1.5rem; }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.plain {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.plain p { margin: 0; color: var(--ink-soft); }

.cta {
  text-align: center;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.cta p { color: var(--ink-soft); max-width: 36rem; margin: 0 auto 1rem; }

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card.empty { text-align: center; color: var(--ink-soft); }

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.store-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.store-card h2 { margin: 0; font-size: 1.1rem; }
.store-card h2 a { text-decoration: none; color: inherit; }
.store-card h2 a:hover { color: var(--brand); }

.store-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.5rem;
}

.store-stats {
  display: flex;
  gap: 1.25rem;
  margin: 0.9rem 0;
}
.store-stats div { margin: 0; }
.store-stats dt { color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.store-stats dd { margin: 0; font-size: 1.1rem; font-weight: 600; }

/* ----------------------------------------------------------------- forms */

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.93rem; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--paper);
  color: var(--ink);
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 12rem; }

.field-error { color: var(--bad); font-size: 0.875rem; margin: 0.35rem 0 0; }

.slug-row { display: flex; align-items: stretch; }
.slug-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
  background: var(--sand);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.slug-row input { border-radius: 0 8px 8px 0 !important; }

.actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn-quiet {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.btn-quiet:hover { background: var(--sand); }
.btn-big { padding: 0.75rem 1.4rem; font-size: 1.05rem; }

/* --------------------------------------------------------------- notices */

.notice {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  border: 1px solid transparent;
}
.notice-good { background: var(--good-bg); color: var(--good); border-color: #cfe8d8; }
.notice-bad { background: var(--bad-bg); color: var(--bad); border-color: #f3ccd6; }

.pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--sand);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.pill-published { background: var(--good-bg); color: var(--good); border-color: #cfe8d8; }
.pill-draft { background: #fff6e5; color: #92400e; border-color: #f3e0bd; }
.pill-suspended { background: var(--bad-bg); color: var(--bad); border-color: #f3ccd6; }

/* ---------------------------------------------------------------- tables */

.table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.table th, .table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.table th { color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- footer */

.footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
}
.footer p { margin: 0; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --ink-soft: #9aa2ad;
    --line: #2c313a;
    --paper: #1a1d23;
    --sand: #121419;
    --good-bg: #13291c;
    --good: #7ee2a8;
    --bad-bg: #2b1119;
    --bad: #ff9bb3;
  }
  .pill-draft { background: #2a2113; color: #e9c46a; border-color: #4a3c1d; }
  .brand-mark { background: linear-gradient(135deg, #4f9cff, #8bb9ff); }
}
