/* Server-rendered pages: sign-in, sign-up, settings, legal, receipts, errors. */
:root {
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8f9fc; --surface-3: #eef1f7;
  --ink: #111827; --ink-2: #4b5563; --ink-3: #8a93a6; --line: #e3e7ef; --line-2: #d3d9e5;
  --acc: #2f5bea; --acc-ink: #ffffff; --acc-soft: #eaf0ff; --acc-line: #c7d5ff;
  --good: #0f8a4f; --good-soft: #e5f6ec; --warn: #b26a00; --warn-soft: #fff4dc; --bad: #c62a2a; --bad-soft: #fde9e9;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1018; --surface: #141a26; --surface-2: #192030; --surface-3: #1f2739;
    --ink: #e8ecf5; --ink-2: #b0b8cb; --ink-3: #7f899f; --line: #252e42; --line-2: #313b52;
    --acc: #7090ff; --acc-ink: #0a0f1e; --acc-soft: #1b2546; --acc-line: #34478a;
    --good: #3ccf86; --good-soft: #10291d; --warn: #f0b04a; --warn-soft: #2c2210; --bad: #ff7676; --bad-soft: #321616;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1018; --surface: #141a26; --surface-2: #192030; --surface-3: #1f2739;
  --ink: #e8ecf5; --ink-2: #b0b8cb; --ink-3: #7f899f; --line: #252e42; --line-2: #313b52;
  --acc: #7090ff; --acc-ink: #0a0f1e; --acc-soft: #1b2546; --acc-line: #34478a;
  --good: #3ccf86; --good-soft: #10291d; --warn: #f0b04a; --warn-soft: #2c2210; --bad: #ff7676; --bad-soft: #321616;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 6px; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 14px; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, input, select, textarea { font: inherit; color: inherit; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.block { width: 100%; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); margin-inline-start: 6px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.note { padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; background: var(--acc-soft); color: var(--acc); }
.note.error { background: var(--bad-soft); color: var(--bad); }
.note.success { background: var(--good-soft); color: var(--good); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.fld { margin-bottom: 14px; }
.fld label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.fld input:not([type="checkbox"]), .fld select, .fld textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
}
.fld input:focus, .fld select:focus { outline: 2px solid var(--acc-line); border-color: var(--acc); }
.fld.has-err input, .fld.has-err select { border-color: var(--bad); }
.fld .hint { font-size: .8rem; color: var(--ink-3); margin-top: 5px; }
.fld .err { font-size: .82rem; color: var(--bad); margin-top: 5px; }
.fld ul { margin: 4px 0 0; padding-inline-start: 18px; font-size: .8rem; color: var(--ink-3); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500 !important; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 4px; accent-color: var(--acc); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: .9rem; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 42px !important; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; opacity: .6; font-size: 1rem; }

.lang-select { padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); }
.brand-link { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; }
.brand-link small { font-weight: 600; color: var(--acc); }
.brand-link:hover { text-decoration: none; }

/* Auth split layout */
.auth { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; min-height: 100vh; }
.auth-pitch { background: linear-gradient(160deg, #1e3a8a, #2f5bea 60%, #6d5bff); color: #fff; padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; }
.auth-pitch .brand-link { color: #fff; }
.auth-pitch .brand-link small { color: #c7d5ff; }
.auth-pitch h2 { font-size: 1.6rem; line-height: 1.25; margin: 30px 0 0; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-pitch li { padding-inline-start: 28px; position: relative; opacity: .95; }
.auth-pitch li::before { content: "✓"; position: absolute; inset-inline-start: 0; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: .75rem; top: 2px; }
.pitch-foot { margin-top: auto; font-size: .82rem; opacity: .75; }
.auth-main { display: flex; flex-direction: column; padding: 20px 24px 40px; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-box { width: 100%; max-width: 420px; margin: auto; padding: 24px 0; }
.auth-box h1 { margin-bottom: 4px; }
.auth-box > .muted { margin: 0 0 22px; }
.alt { text-align: center; margin-top: 18px; font-size: .92rem; color: var(--ink-2); }

/* Simple pages */
.simple-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--surface); gap: 12px; flex-wrap: wrap; }
.top-right { display: flex; gap: 10px; align-items: center; }
.doc { max-width: 760px; margin: 0 auto; padding: 36px 16px 60px; }
.doc.narrow { max-width: 680px; }
.doc p { color: var(--ink-2); }
.form-card { padding: 22px; margin: 18px 0; }
.danger-zone { border-color: var(--bad-soft); }
.simple-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; }
.msg-card { padding: 36px; text-align: center; max-width: 440px; }
.big-code { font-size: 3.4rem; font-weight: 800; color: var(--acc); line-height: 1; margin-bottom: 10px; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 24px 16px 40px; color: var(--ink-3); font-size: .85rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.site-foot a { color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.kv .total { font-size: 1.3rem; font-weight: 700; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-pitch { padding: 24px 20px; }
  .auth-pitch h2 { margin-top: 8px; font-size: 1.25rem; }
  .auth-pitch ul, .pitch-foot { display: none; }
  .grid2, .kv { grid-template-columns: 1fr; }
}
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
