/*
 * White paper download block (book cover + inline lead form), shared by the pages that offer
 * the ORMIT™-OpenJava white paper: download-the-oracle-forms-modernization-whitepaper and
 * products/OracleForms-to-Angular (EN + FR).
 * Same design as the closing section of products/oracle-forms-to-ai-agents (section 13 of
 * oracle-forms-to-ai-agents.css), with page-independent class names: every rule starts with
 * .wpd (class on the section), so nothing here can reach another block or page.
 * Motion: assets/pages/wp-download.js adds html.wpd-anim when motion is allowed; without it
 * (no JS, no IntersectionObserver, reduced motion) the book shows its final state.
 */

.wpd {
	--wpd-blue: #7198ef;
	--wpd-violet: #a581ee;
	--wpd-pink: #ed80ae;
	--wpd-agent: var(--c-agent, #ff5470);
	--wpd-ok: var(--c-ok, #3ccf9e);
	--wpd-night: var(--c-night, #0d1520);
	--wpd-grad: linear-gradient(90deg, var(--wpd-pink), var(--wpd-violet) 50%, var(--wpd-blue));
	overflow: clip;
}

/* Book cover + text and form */
.wpd .wpd__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 980px) { .wpd .wpd__grid { grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); } }
.wpd .wpd-book { position: relative; width: min(100%, 440px); margin: 0 auto; aspect-ratio: 540 / 720; perspective: 1400px; }
@media (max-width: 979px) { .wpd .wpd-book { width: min(70%, 340px); margin: 0 auto 0 4%; } }
.wpd .wpd-book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px 10px 10px 4px; }
.wpd .wpd-book__back { transform: translate(14%, 4%) rotate(5deg) scale(.92); box-shadow: 0 20px 50px rgba(23,35,50,.18); filter: saturate(.9); }
.wpd .wpd-book__front { transform: rotateY(-14deg) rotateX(3deg); transform-origin: left center; box-shadow: -2px 0 0 rgba(255,255,255,.4) inset, 24px 30px 60px rgba(13,21,32,.35); transition: transform .9s var(--ease); }
html.wpd-anim .wpd .wpd-book:not(.is-in) .wpd-book__front { transform: rotateY(-32deg) rotateX(6deg) translateY(10px); }
.wpd .wpd-book__spine { position: absolute; inset: 0 auto 0 0; width: 14px; border-radius: 4px 0 0 4px; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(255,255,255,.08) 60%, transparent); transform: rotateY(-14deg) rotateX(3deg); transform-origin: left center; pointer-events: none; }
.wpd .wpd__text .section-title { max-width: 18ch; }
.wpd .wpd__list { margin: var(--space-4) 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.wpd .wpd__list li { display: flex; gap: 10px; font-size: var(--fs-base); color: var(--c-text); }
.wpd .wpd__list li::before { content: "✓"; color: var(--c-teal); font-weight: 700; }
.wpd .form-panel { margin-top: var(--space-5); }
.wpd .wpd__alt { margin: var(--space-4) 0 0; font-size: var(--fs-sm); color: var(--c-muted); }

/* Native lead form (LeadForge mechanism), styled like the site's x-form. */
.wpd .wpd-lead__title { margin: 0; font-size: var(--fs-xl); letter-spacing: var(--tracking-title); line-height: 1.2; }
.wpd .wpd-lead__intro { margin: 6px 0 var(--space-4); font-size: var(--fs-sm); color: var(--c-muted); }
.wpd .wpd-lead__row { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; }
@media (min-width: 560px) { .wpd .wpd-lead__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wpd .wpd-lead__group { margin-bottom: var(--space-3); min-width: 0; }
.wpd .wpd-lead label { display: block; margin-bottom: 5px; font-size: var(--fs-xs); font-weight: 500; color: #4b5d6b; }
.wpd .wpd-lead label .req { margin-left: 2px; color: var(--c-red); }
.wpd .wpd-lead input[type="text"], .wpd .wpd-lead input[type="email"] { display: block; width: 100%; min-height: 42px; padding: 11px 12px; border: 1px solid #d7dfe3; border-radius: 5px; background: #fff; font: 400 var(--fs-sm)/1.4 var(--font-sans); color: var(--c-ink); transition: border-color .15s, box-shadow .15s; }
.wpd .wpd-lead input:focus { outline: 0; border-color: var(--c-teal); box-shadow: 0 0 0 3px var(--c-focus); }
.wpd .wpd-lead__trap { display: none !important; position: absolute; left: -9999px; }
.wpd .wpd-lead__status { min-height: 1.4em; margin: 6px 0 10px; font-size: var(--fs-xs); font-weight: 600; color: var(--c-red); }
.wpd .wpd-lead .form-submit { display: inline-flex; align-items: center; justify-content: center; gap: 18px; width: 100%; min-height: 45px; padding: 13px 20px; border: 0; border-radius: var(--radius); background: var(--c-red); color: #fff; font: 600 var(--fs-sm)/1.2 var(--font-sans); cursor: pointer; }
.wpd .wpd-lead .form-submit::after { content: "→"; font-size: 1.25em; line-height: 1; }
.wpd .wpd-lead .form-submit:hover { background: var(--c-red-dark); }
.wpd .wpd-lead .form-submit.is-limited { background: #8a96a0; cursor: not-allowed; }
.wpd .wpd-lead .form-submit.is-limited::after { content: none; }
.wpd .wpd-lead .form-submit.is-sending { opacity: .65; cursor: wait; }
.wpd .wpd-lead__privacy { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--c-muted); }
.wpd .wpd-lead__privacy a { color: inherit; text-decoration: underline; }
@media (max-width: 420px) { .wpd .form-panel.wpd-lead { padding: 20px 14px; } }

/* Inline thank-you: once the API has accepted the lead, the form panel gives way to this
   dark panel with the PDF button; the warn variant when no answer came. */
.wpd .wpd-done { position: relative; margin-top: var(--space-5); padding: clamp(26px, 3.4vw, 40px); border: 1px solid rgba(255,255,255,.1); border-top: 3px solid var(--c-red); border-radius: 10px; overflow: hidden; color: var(--c-on-dark);
	background: radial-gradient(120% 120% at 100% 0%, rgba(165,129,238,.28), transparent 55%), radial-gradient(90% 110% at 0% 100%, rgba(237,128,174,.16), transparent 60%), var(--wpd-night);
	box-shadow: 0 24px 60px rgba(13,21,32,.28); }
.wpd .wpd-done[hidden] { display: none; }
.wpd .wpd-done:focus { outline: none; }
.wpd .wpd-done:focus-visible { outline: 2px solid var(--wpd-blue); outline-offset: 3px; }
.wpd .wpd-done__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 50%; background: rgba(60,207,158,.14); color: var(--wpd-ok); box-shadow: 0 0 0 6px rgba(60,207,158,.06); }
.wpd .wpd-done--warn .wpd-done__icon { background: rgba(255,84,112,.14); color: var(--wpd-agent); box-shadow: 0 0 0 6px rgba(255,84,112,.06); }
.wpd .wpd-done__title { margin: 0; font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: var(--tracking-title); color: var(--c-on-dark); overflow-wrap: anywhere; }
.wpd .wpd-done__ready { margin: 8px 0 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.3; background: var(--wpd-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wpd .wpd-done__meta { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--c-on-dark-muted); }
.wpd .wpd-done__dl { margin-top: var(--space-5); width: 100%; justify-content: center; }
.wpd .wpd-done__dl::after { content: "↓"; }
.wpd .wpd-done__note { margin: var(--space-4) 0 0; font-size: var(--fs-sm); line-height: 1.55; color: #b9c4cf; }
.wpd .wpd-done a.u { color: var(--c-on-dark); text-decoration: underline; text-underline-offset: 2px; }
.wpd .wpd-done a[href^="tel:"] { white-space: nowrap; }
.wpd .wpd-done--warn .wpd-done__title { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.wpd .wpd-done__retry { margin-top: var(--space-5); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.22); color: var(--c-on-dark); }
.wpd .wpd-done__retry:hover { border-color: rgba(255,255,255,.45); }
@media (max-width: 420px) { .wpd .wpd-done { padding: 24px 18px; } }

/* Reduced motion: final states, no transitions (also enforced by the script). */
@media (prefers-reduced-motion: reduce) {
	.wpd *, .wpd *::before, .wpd *::after { animation: none !important; transition: none !important; }
}
