:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #1f2a24;
  --muted: #5a665f;
  --brand: #1d6b46;
  --brand-strong: #145134;
  --accent: #e0a526;
  --border: #e3ddd0;
  --info-bg: #eef4fb; --info-fg: #1d4f80;
  --ok-bg: #e7f5ec;   --ok-fg: #155c38;
  --warn-bg: #fdf4e1; --warn-fg: #7a5306;
  --err-bg: #fdecec;  --err-fg: #9b1c1c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.brand { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--brand); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .94rem; }
.small { font-size: .88rem; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card + .card { margin-top: 16px; }

.book { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.book-cover {
  flex: 0 0 72px; height: 96px; border-radius: 6px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff; font-weight: 700; font-size: 11px; padding: 8px; display: flex; align-items: flex-end;
  box-shadow: 2px 3px 0 var(--accent);
}
.price { font-size: 1.35rem; font-weight: 700; color: var(--brand-strong); }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}
input:focus { outline: 3px solid #1d6b4633; border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 14px 20px; margin-top: 18px;
  font: inherit; font-weight: 700; font-size: 1.05rem; text-decoration: none; text-align: center;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--brand); color: #fff;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-secondary { background: #fff; color: var(--brand-strong); border: 2px solid var(--brand); }
.btn-secondary:hover { background: #f1f7f3; }
.btn-big { min-height: 62px; font-size: 1.12rem; }

.spinner {
  width: 20px; height: 20px; flex: 0 0 20px;
  border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; color: var(--brand); margin: 8px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.notice { border-radius: 10px; padding: 12px 14px; margin: 16px 0 0; font-size: .96rem; }
.notice-info { background: var(--info-bg); color: var(--info-fg); }
.notice-success { background: var(--ok-bg); color: var(--ok-fg); }
.notice-warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-error { background: var(--err-bg); color: var(--err-fg); }

.success-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--ok-bg); color: var(--brand); display: grid; place-items: center; font-size: 34px; font-weight: 700;
}
.center { text-align: center; }
.mt { margin-top: 12px; }

.progress { height: 10px; background: #e9e5db; border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.progress.indeterminate > span { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { margin-left: -35%; } to { margin-left: 100%; } }

.help { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 16px; }
.help ol { padding-left: 20px; margin: 0 0 12px; }
.help li { margin-bottom: 6px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .92rem; margin-top: 16px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-all; }
a { color: var(--brand-strong); }
[hidden] { display: none !important; }

/* ---------- Checkout modal ---------- */
dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  border: 0; border-radius: var(--radius); padding: 20px; color: var(--text); background: var(--card);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(20, 30, 25, .55); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; }
.close { border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.dialog-book { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.phone-input { display: flex; align-items: stretch; }
.phone-input span {
  display: flex; align-items: center; padding: 0 12px; font-weight: 600; color: var(--muted);
  background: #f6f3ec; border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px;
}
.phone-input input { border-radius: 0 10px 10px 0; }
.field-error { color: var(--err-fg); font-size: .9rem; margin: 6px 0 0; }
input[aria-invalid="true"] { border-color: var(--err-fg); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; }
details summary { cursor: pointer; padding: 4px 0; }

/* ---------- Order page extras ---------- */
.btn-whatsapp { background: #1f9d55; }
.btn-whatsapp:hover { background: #17803f; }
.ref { font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }
