/**
 * Theme Name: Priovant Child Theme
 * Template:   priovant
 *
 */

/* ========================================
   Marketing form — success + locked states
   (These style OUR marketing sign-up form states; the vendor's parent
   theme styles everything else. The signing form is now fully styled by
   the parent theme's .priovant-signing__* classes — our old signing CSS
   was removed because #signing-page-wrapper{max-width:600px} was squeezing
   the vendor's intended two-column layout.)
   ======================================== */
.priovant-form__error.priovant-form__error--success {
  background-color: #e3f1e6;          /* light green fill */
  color: #1b5e20;                     /* dark green text */
}
.priovant-form__error.priovant-form__error--success::before {
  content: none;
}
.priovant-form input.priovant-form__input--locked {
  background-color: var(--wp--preset--color--lisraya-utility-bg);
  border-color: var(--wp--preset--color--lisraya-blue-muted);
  color: var(--wp--preset--color--lisraya-gray-mid);
  cursor: not-allowed;
  opacity: 1;
}

/* Center the action buttons in a highlight box — used on the signing success
   screen, which offers two actions (Return to homepage / Enroll another
   patient). Replaces an inline style="justify-content:center" (CSP-friendlier
   and lets it wrap on narrow viewports). */
.priovant-highlight__actions--center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* ========================================
   DocuSign classic-view signing modal
   The HCP form uses DocuSign classic embedded view (required for SMS auth),
   which needs a large viewport — the inline container was too small to fill
   out without heavy zooming. We render the signing iframe in a near-full-page
   modal. Classes prefixed pvt-ds- to avoid the parent theme's priovant-*
   namespace.
   ======================================== */
.pvt-ds-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.pvt-ds-modal {
  width: 92vw;
  height: 95vh;
  /* no max-width — keep it wide so zoom has room and doesn't force horizontal scroll */
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pvt-ds-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: auto;          /* allow scrolling if the iframe is taller than the body */
}

/* Inside the modal, force a concrete height so the SDK iframe's height:100%
   resolves (otherwise it falls back to its inline min-height:400px). Also
   override the vendor's .priovant-signing__frame sizing while it lives here. */
.pvt-ds-modal__body #docusign-container {
  width: 100% !important;
  height: 100% !important;      /* resolves against the flex-sized modal body */
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pvt-ds-modal__body #docusign-container iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;     /* defeat the inline min-height:400px */
  max-width: none !important;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .pvt-ds-modal {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: none;
  }
}

/* ========================================
   Two-stage HCP enrollment (prescriber profile)

   The pre-form now carries the prescriber/practice block that used to be
   re-typed inside DocuSign for every patient. These classes are the ones the
   expanded markup introduces; the parent theme styles everything else
   (.priovant-form__field, __row, __submit, .priovant-signing__*).

   Values are taken from the theme's lisraya-* palette variables so this tracks
   the parent theme, with a literal fallback in case a variable is renamed.
   ======================================== */

/* Section headings that break the long pre-form into scannable groups
   (Prescriber information / Office contact / Prescription). */
.priovant-signing__section-title {
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--wp--preset--color--lisraya-blue-muted, #c3c7d4);
  font-size: 1.05rem;
  line-height: 1.3;
}
.priovant-signing__section-title:first-of-type { margin-top: 1rem; }

/* Shown only when the form was prefilled from a saved profile: tells the HCP to
   check the values, and that editing them updates the profile for next time. */
/* Stage 2 opens directly under the reCAPTCHA line that ends stage 1, so the
   gap belongs to the CONTAINER, not to the notice. On the notice it vanished
   whenever no notice was shown — which is the commonest case of all, a
   prescriber with no code filling in a blank form. */
#signing-form-container { padding-top: 1.75rem; }

.priovant-signing__notice {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--wp--preset--color--lisraya-blue-muted, #c3c7d4);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--wp--preset--color--lisraya-utility-bg, #f2f4f6);
  font-size: 0.9rem;
  line-height: 1.5;
}
.priovant-signing__notice[hidden] { display: none; }

/* Same block, amber: the code they typed returned nothing. Not an error — they
   can still enroll — so it is a caution, not the red of a broken field. */
.priovant-signing__notice--warn {
  border-color: var(--wp--preset--color--lisraya-amber-muted, #e0a13c);
  background: var(--wp--preset--color--lisraya-amber-bg, #fdf4e7);
  color: var(--wp--preset--color--lisraya-gray-dark, #3a3f4c);
}

/* Fixed prescription text (drug, directions, quantity) — printed, not entered. */
.priovant-signing__static {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  background: var(--wp--preset--color--lisraya-utility-bg, #f2f4f6);
  color: var(--wp--preset--color--lisraya-gray-mid, #52586a);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* The 6-digit access code on the completion screen. Deliberately loud: it is
   shown once and the HCP needs it to prefill next time. */
/* Buttons that swap their label mid-request must not resize doing it, or the
   layout twitches at exactly the moment the prescriber is watching to see
   whether anything happened.
   
   A min-width wide enough for the longest label it will ever show. Measured on
   staging rather than guessed: Continue is 117px and grows to 144px saying
   "Please wait...", while "Enroll another patient" is 204px and shrinks to
   148px. So each needs a floor at its own widest, and the extra padding on the
   shorter label is the trade — worth it for a button that stays put.
   
   Both are already border-box, so these are the full rendered widths. */
.priovant-form__submit { min-width: 9rem; }              /* 144px */
.priovant-signing__message .priovant-btn { min-width: 13rem; }  /* 208px; also
   evens up "Return to homepage" beside it, which is 194px on its own. */

/* A button mid-request. Matches the Continue button's wait state: same text,
   and visibly not pressable again while the envelope is being created. */
.priovant-btn.is-busy,
.priovant-btn[aria-disabled="true"] {
  opacity: 0.65;
  pointer-events: none;
  cursor: default;
}

/* The result panels — "Thank you" and "Enrollment not completed" — inherit a
   full-bleed box from the parent theme, which stretches a short paragraph and a
   single button across the whole page. Constrained to a readable measure and
   centred, matching the form they replace. */
#signing-message .priovant-highlight__box {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

/* The access code, shown after enrolling. It sits BELOW the buttons now, and is
   styled to match: a quiet aside, not a second call to action. The heavy
   2px-outlined panel above the buttons made an optional convenience look like a
   credential the prescriber was about to lose. */
.priovant-signing__code {
  margin: 1.5rem auto 0;
  max-width: 34rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--wp--preset--color--lisraya-blue-muted, #c3c7d4);
  border-radius: 6px;
  background: var(--wp--preset--color--lisraya-utility-bg, #f2f4f6);
  text-align: center;
}
.priovant-signing__code p { margin: 0 0 0.5rem; }
.priovant-signing__code p:last-child {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--wp--preset--color--lisraya-gray-mid, #52586a);
}
.priovant-signing__code strong {
  font-size: 1.15rem;
  /* Enough tracking that the digits are unambiguous when copied by hand,
     without the billboard letter-spacing it had when it led the screen. */
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* The terminal message (completion / "enrollment not completed"). On cancel,
   step 1 stays on screen, so this box lands directly under the identity form's
   reCAPTCHA line — give it room so the two are not crowded together. */
.priovant-signing__message {
  margin-top: 2rem;
}

/* Checkbox groups (preferred contact method, diagnosis). */
.priovant-form__fieldset {
  border: 1px solid var(--wp--preset--color--lisraya-blue-muted, #c3c7d4);
  border-radius: 4px;
  padding: 0.85rem 1rem 1rem;
  margin: 0 0 1rem;
}
.priovant-form__fieldset > legend {
  padding: 0 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
}
/* Inline variant: options sit on one line and wrap, rather than stacking. */
.priovant-form__check--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1.5rem;
}
.priovant-form__check--inline:last-child { margin-right: 0; }

/* "(optional)" beside a label, and the hint under the access-code field. */
.priovant-form__optional {
  font-weight: 400;
  color: var(--wp--preset--color--lisraya-gray-mid, #52586a);
}
.priovant-form__hint {
  margin: 0.3rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--wp--preset--color--lisraya-gray-mid, #52586a);
}

@media (max-width: 600px) {
  .priovant-form__check--inline {
    display: flex;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  .priovant-signing__code strong { font-size: 1.25rem; }
}

