/* ==========================================================================
   ZANTI PHARMACY — PRESCRIPTIONS PAGE STYLES (assets/css/pages/prescriptions.css)
   Loaded after style.css. Uses shared design tokens only.
   Covers: reassurance strip, steps polish, request-form layout, dropzone
   states (idle / dragover / has-file / error), file chip, contact-method
   pills, honeypot, submit spinner, status area and the success panel.
   ========================================================================== */

/* ---- Reassurance strip ------------------------------------------------- */
.rx-assure {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
}

.rx-assure-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.rx-assure-item .icon-badge { flex: none; }

.rx-assure-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}

.rx-assure-text {
  font-size: var(--fs-sm);
  color: var(--slate);
}

@media (max-width: 899px) {
  .rx-assure { grid-template-columns: 1fr; }
}

/* ---- How-it-works timeline polish -------------------------------------- */
.rx-steps-note {
  margin-top: var(--sp-6);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--slate-soft);
}

/* ---- Emergency notice --------------------------------------------------- */
.rx-emergency {
  max-width: var(--container-narrow);
  margin: 0 auto var(--sp-6);
}

/* ---- Form + aside layout ------------------------------------------------ */
.rx-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: start;
}

@media (max-width: 1023px) {
  .rx-layout { grid-template-columns: 1fr; }
}

/* ---- "Not yet active" configuration panel ------------------------------- */
.rx-config-panel { margin-bottom: var(--sp-5); }

.rx-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* ---- Optional-field label + fieldset ------------------------------------ */
.rx-optional {
  font-weight: 500;
  color: var(--slate-soft);
}

.rx-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--sp-5);
}

.rx-fieldset legend {
  padding: 0;
  margin-bottom: var(--sp-2);
}

/* ---- Preferred contact pills -------------------------------------------- */
.rx-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.rx-choice {
  position: relative;
  cursor: pointer;
}

.rx-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rx-choice-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--slate);
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: border-color var(--speed-fast) ease, background var(--speed-fast) ease,
    color var(--speed-fast) ease, box-shadow var(--speed-fast) ease;
}

.rx-choice-pill .icon { width: 18px; height: 18px; }

.rx-choice:hover .rx-choice-pill {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.rx-choice input:checked + .rx-choice-pill {
  border-color: var(--brand);
  background: var(--mint);
  color: var(--brand-strong);
}

.rx-choice input:focus-visible + .rx-choice-pill {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

/* ---- Dropzone ----------------------------------------------------------- */
.rx-dropzone {
  position: relative;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--mint-soft);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  transition: border-color var(--speed-fast) ease, background var(--speed-fast) ease,
    box-shadow var(--speed-fast) ease;
}

.rx-dropzone .icon-badge { margin: 0 auto var(--sp-3); }

.rx-dropzone-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--sp-1);
}

.rx-dropzone-sub {
  font-size: var(--fs-sm);
  color: var(--slate);
}

.rx-dropzone-browse {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The real input stretches over the whole zone: click + keyboard for free. */
.rx-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.rx-dropzone:hover,
.rx-dropzone:focus-within {
  border-color: var(--brand);
  background: var(--mint);
}

.rx-dropzone:focus-within {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.rx-dropzone.is-dragover {
  border-color: var(--brand-bright);
  border-style: solid;
  background: var(--mint);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.rx-dropzone.has-file {
  border-style: solid;
  border-color: var(--brand);
  background: var(--surface);
}

.field.has-error .rx-dropzone {
  border-color: var(--error);
  background: var(--error-soft);
}

/* ---- Selected-file chip -------------------------------------------------- */
.rx-file-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--mint-soft);
  font-size: var(--fs-sm);
}

.rx-file-chip > .icon {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #FFFFFF;
}

.rx-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}

.rx-file-size {
  flex: none;
  color: var(--slate-soft);
  font-size: var(--fs-xs);
}

.rx-file-remove {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  color: var(--slate);
  transition: background var(--speed-fast) ease, color var(--speed-fast) ease;
}

.rx-file-remove:hover {
  background: var(--error-soft);
  color: var(--error);
}

.rx-file-remove .icon { width: 16px; height: 16px; }

/* ---- Honeypot (must stay invisible but focusable-off) -------------------- */
.rx-hp {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Status area + actions ----------------------------------------------- */
.rx-status:not(:empty) { margin-bottom: var(--sp-5); }

.rx-status .alert { align-items: flex-start; }

.rx-status a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.rx-actions { text-align: center; }

.rx-actions .btn { width: 100%; }

.rx-fineprint {
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--slate-soft);
}

/* ---- Submit spinner ------------------------------------------------------- */
.rx-btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  animation: rx-spin 0.8s linear infinite;
}

@keyframes rx-spin {
  to { transform: rotate(360deg); }
}

#rx-submit.is-loading { opacity: 0.85; }

/* ---- Success panel -------------------------------------------------------- */
#rx-result { outline: none; }

.rx-success {
  text-align: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
}

.rx-success-check {
  display: inline-flex;
  margin-bottom: var(--sp-4);
  animation: rx-pop 0.45s var(--ease-out) both;
}

.rx-success-check svg {
  width: 76px;
  height: 76px;
}

.rx-success-check .rx-check-ring {
  stroke-dasharray: 195;
  stroke-dashoffset: 195;
  animation: rx-draw 0.7s var(--ease-out) 0.15s forwards;
}

.rx-success-check .rx-check-tick {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: rx-draw 0.45s var(--ease-out) 0.6s forwards;
}

@keyframes rx-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes rx-draw {
  to { stroke-dashoffset: 0; }
}

.rx-success h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-3);
}

.rx-success-ref {
  display: inline-block;
  margin: var(--sp-2) 0 var(--sp-4);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--mint);
  border: 1px solid var(--brand-bright);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--brand-strong);
  letter-spacing: 0.04em;
}

.rx-success > p {
  font-size: var(--fs-sm);
  color: var(--slate);
  max-width: 52ch;
  margin-inline: auto;
}

.rx-success-next {
  margin: var(--sp-5) auto;
  padding: var(--sp-5);
  max-width: 460px;
  text-align: left;
  background: var(--mint-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.rx-success-next h4 {
  font-size: var(--fs-body);
  margin-bottom: var(--sp-3);
}

.rx-success-next ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--slate);
}

.rx-success-note {
  font-size: var(--fs-xs) !important;
  color: var(--slate-soft) !important;
}

.rx-success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* ---- Aside -------------------------------------------------------------- */
.rx-aside {
  display: grid;
  gap: var(--sp-5);
  align-content: start;
}

.rx-aside-card .icon-badge { margin-bottom: var(--sp-4); }

.rx-aside-card h3 { margin-bottom: var(--sp-2); }

.rx-aside-card > p { font-size: var(--fs-sm); }

.rx-aside-card .btn { margin-top: var(--sp-4); }

.rx-aside-card .btn + .btn { margin-top: var(--sp-3); }

.rx-aside-card .status-pill { margin: var(--sp-2) 0 var(--sp-3); }

.rx-hours {
  margin: 0;
  display: grid;
}

.rx-hours-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}

.rx-hours-row dt { color: var(--slate); }

.rx-hours-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.rx-privacy-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--slate-soft);
  padding: 0 var(--sp-2);
}

.rx-privacy-note .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--brand);
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .rx-btn-spinner { animation: none; border-top-color: rgba(255, 255, 255, 0.35); }
  .rx-success-check { animation: none; }
  .rx-success-check .rx-check-ring,
  .rx-success-check .rx-check-tick {
    animation: none;
    stroke-dashoffset: 0;
  }
  .rx-dropzone,
  .rx-choice-pill,
  .rx-file-remove { transition: none; }
}
