/* The pink prescription (Muster 16) and the question beneath it. Sizes inside the form are relative
   to its width (container query units), so it scales from phone to desktop like a printed sheet. */

.rx {
  --rx-paper: #f9d5d8;
  --rx-red: #b8202e;   /* deeper than the printed form so the small labels read at 4.5:1 */
  --rx-print: #1f1f22;
  --rx-ink: #2c3c96;
  --rx-stamp: #c2214a;
  --hair: max(1px, 0.16cqw);
  background: var(--paper);
  color: var(--graphite);
  padding-block: clamp(80px, 14vh, 140px) clamp(72px, 12vh, 120px);
  overflow: hidden;
}

.rx__stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 680px);
  margin: max(clamp(32px, 6vh, 56px), calc(var(--px, 3) * 17px + 14px)) auto 0;   /* room for Kirill peeking over */
  padding-bottom: 60px;
  perspective: 1200px;
}

.rx-form {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 148 / 105;
  container-type: inline-size;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%),
    var(--rx-paper);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 100%;
}

.rx-cam {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  color: var(--rx-red);
  font-family: var(--font-sans);
}

.f {
  position: absolute;
  left: calc(var(--l) * 1%);
  top: calc(var(--t) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
}

.rx-frame { border: var(--hair) solid var(--rx-red); }
.rx-field { padding: 0.45cqw 0.7cqw; border-top: var(--hair) solid var(--rx-red); }
.rx-field--col { border-left: var(--hair) solid var(--rx-red); }

.rx-l {
  display: block;
  font: normal 500 1.32cqw/1.12 var(--font-sans);
  color: var(--rx-red);
  white-space: nowrap;
}

.rx-l--right { text-align: right; }
.rx-l--alert { font-weight: 800; }
.rx-l--born { position: absolute; right: 7%; top: 0.45cqw; }

.rx-v {
  display: block;
  min-height: 1.15em;
  margin-top: 0.55cqw;
  padding-left: 0.6cqw;
  font: 500 calc(2.4cqw * var(--fit, 1))/1.15 var(--font-mono);
  color: var(--rx-print);
  white-space: pre;
}

.rx-v--name { margin-top: 1.4cqw; font-size: calc(2.75cqw * var(--fit, 1)); font-weight: 600; }

.rx-tiny {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.3cqw;
  font: 500 0.95cqw/1.05 var(--font-sans);
  text-align: center;
  color: var(--rx-red);
}

.rx-box { border: var(--hair) solid var(--rx-red); }
.rx-box--strong { border-width: max(1.5px, 0.3cqw); }
.rx-box > .rx-l { padding: 0.4cqw 0.6cqw; font-style: normal; }

.rx-num {
  display: grid;
  place-items: center;
  font: 500 2.1cqw/1 var(--font-sans);
}

.rx-pv {
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 2.1cqw/1 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--rx-print);
  white-space: nowrap;
}

.rx-row {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  padding-left: 0.6cqw;
}

.rx-row i {
  align-self: flex-start;
  margin-top: 0.5cqw;
  font: normal 500 1.15cqw/1 var(--font-sans);
  color: var(--rx-red);
  white-space: nowrap;
}

.rx-row .rx-pv { justify-content: flex-start; font-size: 1.75cqw; }

.rx-chk {
  display: grid;
  place-items: center;
  border: var(--hair) solid var(--rx-red);
  background: rgba(255, 255, 255, 0.25);
}

.rx-chk i {
  font: normal 500 0.92cqw/1.05 var(--font-sans);
  text-align: center;
  color: var(--rx-red);
}

.rx-x {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  overflow: visible;
}

.rx-x path { fill: none; stroke: var(--rx-print); stroke-width: 1.5; stroke-linecap: round; }

.rx-rp-label {
  display: flex;
  align-items: center;
  gap: 0.7cqw;
  font: 500 1.45cqw/1 var(--font-sans);
  color: var(--rx-red);
}

.rx-rp-label b { font: 800 2.8cqw/1 var(--font-sans); }

.rx-line {
  display: flex;
  align-items: center;
  font: 500 calc(2.5cqw * var(--fit, 1))/1 var(--font-mono);
  color: var(--rx-print);
  white-space: pre;
  overflow: hidden;
}

.rx-line--main { font-size: calc(3.4cqw * var(--fit, 1)); font-weight: 600; }

/* Red pen: a loose circle around the crossed aut-idem box. */
.rx-circle { overflow: visible; }
.rx-circle path {
  fill: none;
  stroke: var(--rx-stamp);
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.rx-line--strike { letter-spacing: 0.05em; }

.rx-docstamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3cqw;
  padding: 0.8cqw;
  border: max(1px, 0.26cqw) solid var(--rx-ink);
  border-radius: 0.7cqw;
  color: var(--rx-ink);
  font: 600 1.85cqw/1.15 var(--font-sans);
  text-align: center;
  opacity: 0.9;
  transform: rotate(-5deg);
  filter: url(#ink);
  mix-blend-mode: multiply;
}

.rx-docstamp b { font-size: 2.25cqw; font-weight: 800; }

.rx-sign { overflow: visible; }

.rx-sign path {
  fill: none;
  stroke: #1b2a7a;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rx-digits {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: var(--hair) solid var(--rx-red);
  background: rgba(255, 255, 255, 0.3);
}

.rx-digits i {
  display: grid;
  place-items: center;
  border-left: var(--hair) solid var(--rx-red);
  font: normal 600 2.5cqw/1 var(--font-mono);
  color: var(--rx-print);
}

.rx-digits i:first-child { border-left: 0; }

.rx-cut {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 3cqw;
  background: #fffdfd;
  border-top: var(--hair) solid var(--rx-red);
  border-left: var(--hair) solid var(--rx-red);
}

.rx-cut b { font: 500 2.6cqw/1 var(--font-mono); letter-spacing: 0.12em; color: var(--rx-print); }

/* The pharmacy's round stamp: invisible until she says yes. */
.rx-pstamp {
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
  color: var(--rx-stamp);
  opacity: 0;
  transform: rotate(-14deg);
  filter: url(#ink);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.rx-pstamp.is-on { opacity: 0.94; }
.rx-pstamp circle,
.rx-pstamp__tick { stroke: currentColor; }

.rx-pstamp text {
  fill: currentColor;
  font-family: var(--font-sans);
  text-transform: uppercase;
}

.rx-pstamp__ring { font-size: 17px; font-weight: 800; }
.rx-pstamp__mid { font-size: 26px; font-weight: 900; letter-spacing: 1px; }

.rx-splash {
  border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 33, 74, 0) 38%, rgba(194, 33, 74, 0.35) 52%, rgba(194, 33, 74, 0) 68%);
  opacity: 0;
  pointer-events: none;
}

/* Handwritten annotation under the form. */
.rx__note {
  position: absolute;
  left: 2%;
  bottom: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--rx-stamp);
  font: 600 clamp(21px, 4.6vw, 30px)/1 var(--font-hand);
  transform: rotate(-2.5deg);
}

.rx__arrow { flex: none; width: clamp(38px, 8vw, 54px); margin-top: -0.55em; overflow: visible; }
.rx__arrow path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- The question ---------- */

.ask {
  margin-top: clamp(8px, 2vh, 20px);   /* Kirill's spot above the title brings its own room */
  padding-bottom: 96px;   /* free room for "Nein" to dodge into */
  text-align: center;
  transition: opacity 700ms ease;
}

.ask.is-waiting { opacity: 0.35; }

.ask__title {
  font-size: clamp(34px, 6.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.ask__sub {
  margin-top: 10px;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  color: var(--stone);
}

.ask__note { margin-top: 6px; font-size: 15px; color: var(--stone); }

.ask__buttons {
  position: relative;
  margin-top: clamp(28px, 5vh, 44px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

#yes-btn { transition: transform 320ms var(--ease-out), background-color 200ms ease; }
#no-btn { z-index: 3; transition: left 460ms var(--ease-drawer), top 460ms var(--ease-drawer), opacity 200ms ease; }

.ask__hint {
  min-height: 1.5em;
  margin-top: 22px;
  font-size: 17px;
  color: var(--stone);
}

.ask__done-title {
  font-size: clamp(52px, 11vw, 104px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--rose-deep);
}

.ask .link { color: var(--rose-deep); }

.ask__done-sub {
  margin-top: 10px;
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  color: var(--stone);
}

.ask__no-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
}

.ask .share__row { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  #no-btn { transition: none; }
  .ask { transition: none; }
}
