/* =============================================================================
   Shared styles for the signup / account screens
   =============================================================================
   Plain CSS with no build step: these pages must render before any JS runs and
   must keep working if the JS bundle fails, because they are the only path a
   new customer has into the product.
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #14181d;
  --text-muted: #5d6873;
  /* Brand green, taken from the "Auto" half of the wordmark. */
  --accent: #3fbf4f;
  --accent-hover: #35a643;
  --wordmark: #1e2530;
  --accent-contrast: #ffffff;
  --danger: #c8372d;
  --danger-bg: #fdeceb;
  --success: #0f7b3f;
  --success-bg: #e8f6ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 29, 0.04), 0 4px 16px rgba(20, 24, 29, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --surface: #1c2127;
    --border: #2c333b;
    --text: #eef1f4;
    --text-muted: #9aa5b1;
    --wordmark: #eef1f4;
    --danger: #ff8b81;
    --danger-bg: #3a1e1c;
    --success: #6ee7a0;
    --success-bg: #16301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 64px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', 'Segoe UI', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 420px; margin: 0 auto; }
.shell--wide { max-width: 880px; }

/* ── Brand lockup ──────────────────────────────────────────────────────────
   The mark is an <img> and the wordmark is live text rather than one flat
   image: the text stays selectable, scales with the user's font size, and
   recolours for dark mode, none of which a raster lockup can do.
   ------------------------------------------------------------------------ */

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 32px;
  text-decoration: none;
}

.brand__mark {
  width: 38px;
  height: 36px;
  flex: none;
}

.brand__text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--wordmark);
  white-space: nowrap;
}

.brand__auto { color: var(--accent); }

/* Tagline. Shown on the landing and signup screens, where a first-time
   visitor still needs telling what this is. */
.brand__tagline {
  margin: -20px 0 32px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: 0.01em; }
h2 { margin: 32px 0 12px; font-size: 16px; }
.lede { margin: 0 0 28px; color: var(--text-muted); font-size: 14px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.field { margin-bottom: 20px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}

.hint { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; font-weight: 400; }

input[type='text'],
input[type='email'],
input[type='password'] {
  width: 100%;
  padding: 11px 13px;
  font-size: 16px; /* 16px stops iOS Safari zooming the page on focus */
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 191, 79, 0.18);
}

input[aria-invalid='true'] { border-color: var(--danger); }

.btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}
.btn--secondary:hover:not(:disabled) { background: var(--bg); }

/* ── Feedback ──────────────────────────────────────────────────────────── */

.alert {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.alert--error { color: var(--danger); background: var(--danger-bg); }
.alert--success { color: var(--success); background: var(--success-bg); }
.alert[hidden] { display: none; }

.meta {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.meta a { color: var(--text); }

a { color: var(--accent); }

/* ── Plans ─────────────────────────────────────────────────────────────── */

.plans {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 24px;
}

.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.plan--featured { border-color: var(--accent); border-width: 2px; }

.plan__badge {
  position: absolute;
  top: -11px;
  left: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
}

.plan__name { font-size: 14px; font-weight: 700; margin: 0; }
.plan__price { margin: 8px 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.plan__price small { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plan__audience { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }

.plan__features { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.plan__features li { padding: 4px 0 4px 20px; position: relative; }
.plan__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── Usage ─────────────────────────────────────────────────────────────── */

.usage { margin: 4px 0 0; }
.usage__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.usage__fill { height: 100%; background: var(--accent); border-radius: 999px; }
.usage__fill--warn { background: #e8a33d; }
.usage__fill--over { background: var(--danger); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.row:last-child { border-bottom: none; }
.row dt { color: var(--text-muted); margin: 0; }
.row dd { margin: 0; font-weight: 600; }

/* ── Onboarding steps ──────────────────────────────────────────────────── */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step {
  counter-increment: step;
  position: relative;
  padding: 14px 0 14px 40px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.step:last-child { border-bottom: none; }
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
}
.step--done::before {
  content: '✓';
  color: var(--accent-contrast);
  background: var(--accent);
  border-color: var(--accent);
}
.step__title { font-weight: 600; }
.step__body { color: var(--text-muted); font-size: 13px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Legal documents ───────────────────────────────────────────────────────
   Terms, privacy policy and the 特定商取引法 disclosure. Long-form prose, so
   the measure is narrower than the app screens and the type is set for reading
   rather than scanning.
   ------------------------------------------------------------------------ */

.legal { font-size: 14px; }
.legal h2 {
  margin: 36px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 16px;
}
.legal h2:first-of-type { border-top: none; padding-top: 0; margin-top: 24px; }
.legal h3 { margin: 20px 0 8px; font-size: 14px; }
.legal p { margin: 0 0 12px; }
.legal ol, .legal ul { margin: 0 0 12px; padding-left: 1.6em; }
.legal li { margin-bottom: 6px; }
.legal ol ol { margin-top: 6px; list-style-type: lower-roman; }

/* 特商法 disclosure: label/value pairs that must stay readable on a phone. */
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-table th,
.legal-table td {
  padding: 14px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.legal-table th {
  width: 34%;
  padding-right: 16px;
  font-weight: 600;
  color: var(--text-muted);
}
@media (max-width: 560px) {
  .legal-table th, .legal-table td { display: block; width: 100%; padding: 0; }
  .legal-table th { padding-top: 14px; border-bottom: none; }
  .legal-table td { padding: 2px 0 14px; }
}

/* Unfilled mandatory fields. Loud on purpose — 特商法 disclosure is a legal
   requirement, and shipping it with a gap is worse than shipping it late. */
.todo {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
}

.legal-updated { margin-top: 40px; font-size: 13px; color: var(--text-muted); text-align: right; }

/* =============================================================================
   Landing page
   =============================================================================
   Wider than the app screens and full-bleed in places, so it opts out of the
   .shell measure. Everything here is prefixed .lp- to keep it from leaking into
   the account screens, which share this stylesheet.
   ========================================================================== */

.lp { max-width: 1040px; margin: 0 auto; }

.lp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 32px;
}
.lp-nav .brand { margin: 0; }
.lp-nav__actions { display: flex; align-items: center; gap: 8px; }

.btn--sm {
  display: inline-block;
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  text-decoration: none;
  text-align: center;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.lp-hero { text-align: center; padding: 32px 0 8px; }
.lp-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(28px, 5.5vw, 44px);
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.lp-hero__sub {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: clamp(14px, 2.2vw, 16px);
}
.lp-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 440px;
  margin: 0 auto;
}
.lp-cta .btn { flex: 1 1 190px; text-decoration: none; text-align: center; }

.lp-hero__note { margin-top: 14px; font-size: 12px; color: var(--text-muted); }

.lp-figure { margin: 48px auto 0; max-width: 780px; }
.lp-figure svg { width: 100%; height: auto; display: block; }

/* ── Sections ──────────────────────────────────────────────────────────── */

.lp-section { padding: 72px 0; border-top: 1px solid var(--border); }
.lp-section:first-of-type { border-top: none; }

.lp-section__label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.lp-section h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 3.6vw, 28px);
  line-height: 1.5;
  letter-spacing: -0.01em;
  border: none;
  padding: 0;
}
.lp-section__lede { margin: 0 0 36px; color: var(--text-muted); font-size: 15px; max-width: 640px; }

.lp-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.lp-card__icon { width: 40px; height: 40px; margin-bottom: 14px; display: block; }
.lp-card h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: -0.01em; }
.lp-card p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Pain points: deliberately plainer than the feature cards so the page does
   not look like it is celebrating the reader's problems. */
.lp-pains { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.lp-pain {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.lp-pain::before { content: '✓'; color: var(--accent); font-weight: 700; flex: none; }

/* ── Feature list ──────────────────────────────────────────────────────── */

.lp-features { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.lp-features h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.lp-features ul { margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text-muted); }
.lp-features li { padding: 5px 0 5px 18px; position: relative; }
.lp-features li::before {
  content: '';
  position: absolute;
  left: 0; top: 13px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.lp-soon {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  vertical-align: 1px;
}

/* ── Steps ─────────────────────────────────────────────────────────────── */

.lp-steps { counter-reset: lpstep; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lp-step { counter-increment: lpstep; padding-top: 46px; position: relative; }
.lp-step::before {
  content: counter(lpstep);
  position: absolute; top: 0; left: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  color: var(--accent-contrast);
  background: var(--accent);
}
.lp-step h3 { margin: 0 0 8px; font-size: 15px; }
.lp-step p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */

.lp-faq details {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.lp-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '＋'; color: var(--accent); flex: none; }
.lp-faq details[open] summary::after { content: '−'; }
.lp-faq p { margin: 14px 0 0; font-size: 14px; color: var(--text-muted); }

/* ── Closing CTA ───────────────────────────────────────────────────────── */

.lp-final {
  text-align: center;
  padding: 64px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 72px 0 0;
}
.lp-final h2 { margin: 0 0 12px; font-size: clamp(20px, 3.4vw, 26px); border: none; padding: 0; }
.lp-final p { margin: 0 0 28px; color: var(--text-muted); font-size: 15px; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.lp-footer {
  margin-top: 64px;
  padding: 32px 0 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.lp-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; }
.lp-footer a { color: var(--text-muted); }
.lp-footer__legal { font-size: 12px; line-height: 1.8; }
