/* Zehnama — order, legal and admin pages. Charcoal ink on parchment, as the site and the app. */
:root {
  --ink: #2A2D38;
  --text: #1A1D2E;
  --muted: #545A6D;        /* 6:1 on parchment */
  --paper: #F7F3EA;
  --card: #FFFDF9;
  --line: #D9D3C6;
  --error: #A4261C;
  --ok: #2E6B30;
  --focus: #F2B630;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: #000; }
h1, h2 { font-family: Lora, Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -0.3px; line-height: 1.2; }
h1 { font-size: 2.1rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus); border-radius: 4px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 253, 249, 0.7); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 68px; max-width: 1120px; }
.brand img { display: block; height: 34px; width: auto; }
.header-row nav { margin-left: auto; display: flex; gap: 22px; font-weight: 500; }
.header-row nav a { text-decoration: none; color: var(--muted); }
.header-row nav a:hover { color: var(--text); }
main { padding: 40px 24px 72px; }

.site-footer { border-top: 1px solid var(--line); background: #F0EBDF; font-size: 0.85rem; color: var(--muted); }
.footer-row { max-width: 1120px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 28px 24px; }
.footer-logo { height: 26px; width: auto; }
.footer-row p { margin: 0; }
.footer-row nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 18px; }

.lead { font-size: 1.1rem; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; }
.price-card h2 { margin-top: 0; }
.ticks { padding-left: 1.2rem; }
.ticks li { margin-bottom: 0.5rem; }
.steps li { margin-bottom: 0.5rem; }
.notice { background: #FBF4E2; border-left: 4px solid #B07A10; padding: 12px 16px; border-radius: 8px; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0.2rem 0 0.5rem; }
.opt { font-weight: 400; color: var(--muted); }
.aside { color: var(--muted); }
.warn { font-weight: 600; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px; border-radius: 999px; background: var(--ink); color: #fff; border: 2px solid var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #15171E; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); }
.btn-ghost:hover { background: #F0EBDF; color: var(--ink); }
.btn-danger { background: #fff; color: var(--error); border-color: var(--error); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 0.9rem; }

/* Form */
.order-form { margin-top: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
legend { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.6rem; }
.field { margin-bottom: 1.2rem; }
.field > label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type=text], input[type=email], input[type=tel], input[type=search], textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 2px solid #8E8778; border-radius: 10px; padding: 10px 12px;
}
input[readonly] { background: #F0EBDF; }
textarea { resize: vertical; }
.choice { display: flex; gap: 12px; align-items: flex-start; margin: 0.4rem 0; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.choice label { font-weight: 400; }
.waiver { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.has-error input, .has-error textarea { border-color: var(--error); }
.has-error { border-left: 4px solid var(--error); padding-left: 14px; }
.error { color: var(--error); font-weight: 600; margin: 0.2rem 0 0.4rem; }
.error-summary { border: 3px solid var(--error); border-radius: 12px; padding: 16px 20px; background: #fff; margin: 1rem 0 1.5rem; }
.error-summary h2 { font-family: inherit; font-size: 1.1rem; margin: 0 0 0.5rem; }
.error-summary a { color: var(--error); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.order-ref { font-family: Consolas, "Courier New", monospace; font-size: 1.9rem; font-weight: 700; letter-spacing: 1px; background: var(--card); border: 2px dashed var(--ink); border-radius: 12px; display: inline-block; padding: 10px 20px; margin: 0.4rem 0 0.6rem; }

.toc { display: flex; flex-wrap: wrap; gap: 18px; margin: 0.5rem 0 1rem; }
.eula { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 24px; font-size: 0.95rem; }

/* Admin */
.site-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 1rem 0; }
.site-switch h2 { font-family: inherit; font-size: 1rem; margin: 0; }
.site-switch .hint { flex-basis: 100%; margin: 0; }
main:has(.orders) { max-width: 1240px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin: 1rem 0; }
.search { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; flex: 1; }
.search label { width: 100%; font-weight: 600; }
.search input { max-width: 360px; }
.table-wrap { position: relative; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.orders { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.orders th, .orders td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.orders thead th { background: #F0EBDF; font-weight: 600; white-space: nowrap; }
.orders tbody th { font-family: Consolas, monospace; font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid currentColor; }
.badge-ordered { color: #6B4E00; }
.badge-paid { color: #1F4E8C; }
.badge-issued { color: var(--ok); }
.badge-cancelled { color: var(--muted); }
dialog { border: 0; border-radius: 16px; padding: 24px 28px; width: min(640px, 94vw); max-height: 90vh; box-shadow: 0 30px 80px rgba(0,0,0,0.35); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(26, 29, 46, 0.45); }
dialog h2 { margin-top: 0; font-size: 1.3rem; }
.details { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 0.9rem; margin: 0 0 1rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .header-row { gap: 12px; }
  .footer-row nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
