/* Reading Room pre-order dialog (preorder.js). Uses the page's tokens. */
.po-scrim {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 18, 12, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.3s ease;
}
.po-scrim.is-open { opacity: 1; }
html.po-lock { overflow: hidden; }

.po-card {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  display: grid; grid-template-columns: 0.85fr 1.15fr; border-radius: 26px; background: #FAF9F6;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.55); transform: translateY(18px) scale(0.98);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Montserrat', sans-serif; color: var(--text-dark, #233027);
}
.po-scrim.is-open .po-card { transform: none; }

.po-close {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(12, 30, 20, 0.06); color: var(--dark-green, #0C1E14);
}
.po-close:hover { background: rgba(12, 30, 20, 0.12); }
.po-close svg { width: 18px; height: 18px; }

/* Left: the cover on deep green with turning gold rings */
.po-stage {
  position: relative; overflow: hidden; padding: 2.6rem 2rem; display: grid; place-items: center;
  background: radial-gradient(circle at 80% 0%, rgba(229, 198, 151, 0.22), transparent 50%), linear-gradient(160deg, #10271A, #0C1E14 60%, #0A1911);
}
.po-stage::before, .po-stage::after {
  content: ''; position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1px dashed rgba(229, 198, 151, 0.28);
  transform: translate(-50%, -50%); animation: po-turn 60s linear infinite;
}
.po-stage::before { width: 360px; height: 360px; }
.po-stage::after { width: 470px; height: 470px; border-style: solid; border-color: rgba(229, 198, 151, 0.12); animation-direction: reverse; }
@keyframes po-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
.po-cover { position: relative; z-index: 1; width: min(190px, 60%); filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45)); transform: rotate(-3deg); }
.po-ribbon {
  position: absolute; z-index: 2; left: 50%; bottom: 1.5rem; transform: translateX(-50%); white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.5rem 1rem; border-radius: 999px; background: var(--gold-light, #E5C697); color: var(--dark-green, #0C1E14);
}

/* Right: the form */
.po-body { padding: 2.6rem 2.4rem 2.2rem; }
.po-kicker { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-dark, #917551); }
.po-kicker::before { content: ''; width: 22px; height: 1px; background: currentColor; }
.po-title { font-family: 'Playfair Display', serif; font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; color: var(--dark-green, #0C1E14); margin: 0.7rem 0 0.8rem; }
.po-title em { color: var(--gold-dark, #917551); }
.po-lead { font-size: 0.92rem; line-height: 1.7; color: var(--text-muted, #5A6D60); margin: 0 0 1rem; }
.po-when { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 600; color: var(--dark-green, #0C1E14); background: rgba(229, 198, 151, 0.35); padding: 0.4rem 0.8rem; border-radius: 999px; margin-bottom: 1.1rem; }
.po-when svg { width: 14px; height: 14px; color: var(--gold-dark, #917551); }
.po-field { display: block; margin-bottom: 0.85rem; }
.po-field span { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted, #5A6D60); margin-bottom: 0.35rem; }
.po-field small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.po-input {
  width: 100%; box-sizing: border-box; padding: 0.85rem 0.95rem; border-radius: 12px; border: 1px solid rgba(145, 117, 81, 0.3);
  background: #fff; font: inherit; font-size: 16px; color: var(--dark-green, #0C1E14); transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.po-input:focus { outline: none; border-color: var(--gold-dark, #917551); box-shadow: 0 0 0 3px rgba(145, 117, 81, 0.16); }
.po-consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.8rem; line-height: 1.55; color: var(--text-muted, #5A6D60); margin: 0.3rem 0 1.1rem; cursor: pointer; }
.po-consent input { width: 18px; height: 18px; margin: 0.1rem 0 0; accent-color: var(--dark-green, #0C1E14); flex: none; }
.po-consent a { color: var(--gold-dark, #917551); }
.po-submit {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 52px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--dark-green, #0C1E14); color: var(--gold-light, #E5C697); font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  box-shadow: 0 14px 30px -14px rgba(12, 30, 20, 0.6); transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}
.po-submit:hover { transform: translateY(-2px); }
.po-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }
.po-submit svg, .lib-btn .po-bell { width: 16px; height: 16px; }
.po-error { display: none; margin: 0 0 0.9rem; padding: 0.7rem 0.9rem; border-radius: 10px; background: rgba(124, 64, 72, 0.08); color: #7C4048; font-size: 0.84rem; line-height: 1.5; }
.po-error.show { display: block; }
.po-fine { font-size: 0.74rem; color: var(--text-muted, #5A6D60); text-align: center; margin: 0.9rem 0 0; line-height: 1.5; }
.po-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Success */
.po-done { text-align: center; padding: 1.2rem 0 0.4rem; }
.po-done[hidden], .po-form[hidden] { display: none; }
.po-check { width: 84px; height: 84px; margin: 0 auto 1.2rem; }
.po-check circle { fill: none; stroke: var(--gold-dark, #917551); stroke-width: 2; stroke-dasharray: 252; stroke-dashoffset: 252; animation: po-draw 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.po-check path { fill: none; stroke: var(--dark-green, #0C1E14); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: po-draw 0.5s 0.6s ease forwards; }
@keyframes po-draw { to { stroke-dashoffset: 0; } }
.po-done .po-title { margin-top: 0; }
.po-again { margin-top: 1.3rem; background: transparent; color: var(--dark-green, #0C1E14); border: 1px solid rgba(12, 30, 20, 0.2); box-shadow: none; }

/* "Notify me" buttons on the shelf */
.lib-btn.is-on-list { background: rgba(47, 111, 79, 0.1); color: #2f6f4f; border-color: rgba(47, 111, 79, 0.3); }
.lib-btn--notify { padding-left: 0.95rem; padding-right: 1.05rem; gap: 0.45rem; font-size: 0.78rem; }
.lib-price small.po-price-note { display: block; font-family: 'Montserrat', sans-serif; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dark, #917551); }

@media (max-width: 720px) {
  .po-scrim { align-items: end; padding: 0; }
  .po-card { grid-template-columns: 1fr; border-radius: 24px 24px 0 0; max-height: 94vh; max-height: 94dvh; }
  .po-stage { padding: 1.6rem 1rem 3.2rem; }
  .po-cover { width: 120px; }
  .po-stage::before { width: 240px; height: 240px; }
  .po-stage::after { width: 320px; height: 320px; }
  .po-ribbon { bottom: 1rem; }
  .po-body { padding: 1.6rem 1.3rem calc(1.6rem + env(safe-area-inset-bottom)); }
  .po-close { background: rgba(250, 249, 246, 0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .po-scrim, .po-card { transition: none; }
  .po-stage::before, .po-stage::after { animation: none; }
  .po-check circle, .po-check path { animation: none; stroke-dashoffset: 0; }
}
/* On a shelf card the ribbon and the button already say it. */
.lib-book-foot .po-price-note { display: none; }
