/* Holistat Digital F2F Referral Portal */

.portal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
}

.portal-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.portal-section__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.portal-section__num {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: #ecfdf5;
  color: #0f766e;
  font-size: 0.875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-section__body {
  padding: 1.25rem;
}

.portal-field label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.375rem;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: rgba(248, 250, 252, 0.6);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.portal-field input.portal-field--error,
.portal-field textarea.portal-field--error {
  border-color: #ef4444;
}

.portal-service {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.portal-service:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.portal-service input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: #0d9488;
}

.signature-wrap {
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.signature-wrap canvas {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
}

.signature-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #64748b;
}

.signature-toolbar button {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f766e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.signature-toolbar button:hover {
  background: #ecfdf5;
}

.portal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: #1e3a4c;
  border-radius: 1rem;
  color: #fff;
}

@media (min-width: 640px) {
  .portal-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.portal-actions__note {
  font-size: 0.8125rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.portal-actions__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .portal-actions__buttons {
    flex-direction: row;
    width: auto;
  }
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.portal-btn--primary {
  background: #14b8a6;
  color: #042f2e;
}

.portal-btn--primary:hover:not(:disabled) {
  background: #2dd4bf;
}

.portal-btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-btn--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.portal-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.portal-modal[hidden] {
  display: none;
}

.portal-modal__panel {
  width: min(920px, 100%);
  max-height: 92vh;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.portal-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.portal-modal__body {
  overflow: auto;
  padding: 1rem;
  background: #64748b;
}

.portal-modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.portal-preview-frame {
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.portal-phase-notice {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Off-screen PDF export template (rendered for html2canvas) */
.pdf-export-root {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 8.5in;
  pointer-events: none;
  z-index: -1;
}

.pdf-export-root .form-page {
  width: 8.5in;
  height: 11in;
  padding: 0.22in 0.4in 0.2in;
  display: flex;
  flex-direction: column;
  background: #fef9ed;
  color: #1a2836;
  font-family: 'Atkinson Hyperlegible', Arial, Helvetica, sans-serif;
  font-size: 9.25pt;
  line-height: 1.35;
  overflow: hidden;
}

.pdf-export-root .cred {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 7pt;
  font-weight: 700;
  color: #0d5f78;
  margin-bottom: 0.05in;
}

.pdf-export-root .header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.16in;
  margin-bottom: 0.07in;
}

.pdf-export-root .header__logo img,
.pdf-export-root .header__logo-img {
  display: block;
  width: 2.45in;
  height: auto;
  max-height: 0.95in;
  object-fit: contain;
  object-position: left center;
}

.pdf-export-root .header__contact {
  text-align: right;
  font-size: 7.75pt;
  line-height: 1.4;
}

.pdf-export-root .header__contact strong {
  display: block;
  font-size: 8.5pt;
  color: #1a3344;
  margin-bottom: 0.02in;
}

.pdf-export-root .title-bar {
  background: #127194;
  color: #fff;
  text-align: center;
  padding: 0.07in 0.12in;
  margin-bottom: 0.1in;
}

.pdf-export-root .title-bar h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11.5pt;
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
}

.pdf-export-root .title-bar p {
  font-size: 7.5pt;
  margin: 0.03in 0 0;
}

.pdf-export-root .form-fill {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pdf-export-root .section-label {
  font-size: 8.5pt;
  font-weight: 700;
  color: #1a3344;
  margin: 0 0 0.05in;
}

.pdf-export-root .field-row {
  display: flex;
  align-items: flex-end;
  gap: 0.14in;
  margin-bottom: 0.09in;
}

.pdf-export-root .field { flex: 1; min-width: 0; }
.pdf-export-root .field--narrow { flex: 0 0 1.75in; }

.pdf-export-root .field__label {
  font-size: 8pt;
  font-weight: 700;
  color: #0d5f78;
  margin-bottom: 0.04in;
}

.pdf-export-root .field__value {
  border: 1px solid #9bb5c4;
  border-bottom: 1.5px solid #1a3344;
  background: #fff;
  min-height: 0.28in;
  font-size: 9pt;
  padding: 0.04in 0.08in 0.02in;
  word-break: break-word;
}

.pdf-export-root .cert {
  font-size: 9pt;
  line-height: 1.38;
  margin-bottom: 0.08in;
}

.pdf-export-root .writing-block {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-bottom: 0.08in;
}

.pdf-export-root .block-label {
  font-size: 8.25pt;
  font-weight: 700;
  color: #0d5f78;
  margin-bottom: 0.04in;
  line-height: 1.3;
}

.pdf-export-root .block-area {
  border: 1px solid #9bb5c4;
  border-bottom: 1.5px solid #1a3344;
  background: #fff;
  padding: 0.08in 0.1in;
  margin-bottom: 0.1in;
  font-size: 9pt;
  white-space: pre-wrap;
  word-break: break-word;
}

.pdf-export-root .block-area--conditions {
  flex: 1 1 auto;
  min-height: 1.35in;
}

.pdf-export-root .block-area--homebound {
  min-height: 0.82in;
  margin-bottom: 0;
}

.pdf-export-root .services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.05in 0.08in;
  margin-bottom: 0.1in;
}

.pdf-export-root .check {
  display: flex;
  align-items: flex-start;
  gap: 0.06in;
  font-size: 8.25pt;
  font-weight: 700;
  line-height: 1.25;
}

.pdf-export-root .check__box {
  width: 0.14in;
  height: 0.14in;
  border: 1.5px solid #1a3344;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8pt;
  line-height: 1;
  background: #fff;
}

.pdf-export-root .sig-row {
  display: grid;
  grid-template-columns: 1.55fr 1.05fr 0.72fr;
  gap: 0.12in;
  margin-bottom: 0.1in;
}

.pdf-export-root .sig-box {
  border: 1px solid #9bb5c4;
  border-bottom: 1.5px solid #1a3344;
  background: #fff;
  min-height: 0.68in;
  display: flex;
  align-items: center;
  padding: 0.04in 0.06in;
}

.pdf-export-root .sig-line {
  border: 1px solid #9bb5c4;
  border-bottom: 1.5px solid #1a3344;
  background: #fff;
  min-height: 0.3in;
  font-size: 9pt;
  padding: 0.04in 0.08in 0.02in;
  word-break: break-word;
}

.pdf-export-root .sig-img {
  max-height: 0.58in;
  max-width: 100%;
  display: block;
}

.pdf-export-root .form-bottom {
  flex-shrink: 0;
}

.pdf-export-root .legal-notes {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.12in;
  border-top: 1px solid #9bb5c4;
  padding-top: 0.07in;
  margin-bottom: 0.06in;
}

.pdf-export-root .legal {
  font-size: 6.75pt;
  line-height: 1.32;
}

.pdf-export-root .notes {
  font-size: 6.5pt;
  line-height: 1.3;
}

.pdf-export-root .notes p { margin: 0; }
.pdf-export-root .notes p + p { margin-top: 0.04in; }

.pdf-export-root .footer {
  flex-shrink: 0;
  background: #127194;
  color: #fff;
  text-align: center;
  padding: 0.06in 0.1in;
  font-size: 7.25pt;
  font-weight: 700;
  line-height: 1.35;
}

.pdf-export-root .footer span {
  display: block;
  font-weight: 400;
  opacity: 0.92;
}
