/*
 * MukenVault Founding 100 application form styles.
 * Loaded via <link rel="stylesheet" href="/static/apply.css">. The page CSP
 * is `style-src 'self'` — no inline <style> tags, no style="…" attributes,
 * no @import of external sheets. JS-driven element.style.* assignments are
 * fine (CSP does not gate them) and are used in apply.js for show/hide.
 */

/* ─── honeypot ───
 * Inline style="position:absolute; left:-9999px" would be invalid under
 * the page CSP and the honeypot would render inside the form. The .hp
 * class shifts the wrapper off-screen without violating CSP. The first
 * v1.x review (M-b) traced a real silent-failure to inline style; do not
 * inline this back into the HTML.
 */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ─── reset ─── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ─── page ─── */
:root {
  --bg:        #f6f7f9;
  --panel:     #ffffff;
  --ink:       #1c1e22;
  --muted:     #6b7079;
  --line:      #d8dce3;
  --accent:    #1e4a72;   /* deep blue: security/trust */
  --accent-hi: #2a5f8f;
  --err:       #b3261e;
  --req:       #8a3d22;
  --opt:       #5b6470;
  --hint:      #6b7079;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP",
               Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1 0 auto;
}

/* ─── brand header ─── */
.brand-mark {
  margin: 0 0 4px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.brand h1 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
}

/* ─── purpose notice ─── */
.purpose {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 28px;
  font-size: 14px;
}

.purpose h2 {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.purpose p {
  margin: 0;
  color: var(--ink);
}

/* ─── form ─── */
#apply-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 24px;
}

.row {
  margin-bottom: 22px;
}

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

.req {
  font-size: 11px;
  font-weight: 600;
  color: var(--req);
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--req);
  border-radius: 3px;
  vertical-align: middle;
}

.opt {
  font-size: 11px;
  font-weight: 500;
  color: var(--opt);
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid var(--opt);
  border-radius: 3px;
  vertical-align: middle;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 15px;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 74, 114, 0.12);
}

.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--hint);
}

.err {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--err);
  min-height: 1.4em;
}

.err:empty {
  display: none;
}

.err.generic:not(:empty) {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--err);
  background: #fdf2f1;
  border-radius: 4px;
}

/* ─── checkbox row ─── */
.row.check label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
}

.row.check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
}

.row.check a {
  color: var(--accent);
}

/* ─── actions ─── */
.actions {
  margin-top: 8px;
}

button[type="submit"] {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-width: 160px;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--accent-hi);
}

button[type="submit"]:disabled {
  background: var(--muted);
  cursor: progress;
}

/* ─── thanks panel ─── */
.thanks {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 28px 24px;
}

.thanks h2 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 20px;
}

.thanks p {
  margin: 0;
}

/* ─── noscript fallback ─── */
.noscript {
  background: #fff8e1;
  border: 1px solid #d4a93f;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 20px;
}

/* ─── footer ─── */
.footer {
  flex: none;
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
}

/* ─── legal pages (/founding50/privacy, /founding50/terms) ───
 * Shared stylesheet keeps the brand consistent between the form and the
 * supporting legal documents. The legal pages are mostly long-form prose
 * with a few tables and nested lists; the rules below tighten table
 * borders, give nested <ul> inside <ol> sufficient indent, and add a
 * "back to form" link style. Apply.css is loaded by all three pages so
 * any addition here also ships to the form — keep the .legal-page
 * prefix scoping conservative.
 */

.legal-page h1 {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.legal-page .doc-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 12px 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.legal-page .doc-meta dt {
  font-weight: 600;
  color: var(--ink);
}

.legal-page .doc-meta dd {
  margin: 0;
}

.legal-page section {
  margin: 0 0 28px;
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin: 24px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.legal-page h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 6px;
}

.legal-page p {
  margin: 0 0 12px;
  font-size: 15px;
}

.legal-page ul,
.legal-page ol {
  padding-left: 24px;
  margin: 0 0 14px;
}

.legal-page li {
  margin-bottom: 6px;
  font-size: 15px;
}

.legal-page ol > li > ul {
  margin-top: 6px;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.legal-page th,
.legal-page td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border: 1px solid var(--line);
}

.legal-page th {
  background: #eef1f5;
  font-weight: 600;
}

.legal-page hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.legal-page .back {
  margin-top: 32px;
  font-size: 14px;
}

.legal-page .back a {
  color: var(--accent);
  text-decoration: none;
}

.legal-page .back a:hover {
  text-decoration: underline;
}

/* ─── responsive ─── */
@media (max-width: 520px) {
  .wrap { padding: 20px 16px 40px; }
  .brand h1 { font-size: 22px; }
  #apply-form { padding: 22px 16px; }
  button[type="submit"] { width: 100%; }
  .legal-page h1 { font-size: 19px; }
  .legal-page table { font-size: 13px; }
  .legal-page th, .legal-page td { padding: 6px 8px; }
}
