/* =========================================================================
   Patient portal styles - loaded after site.css, reuses its palette
   variables (--ink, --primary, --line, --muted, --shadow). Patient pages
   print on A4: the site chrome and the buttons drop out, the glass turns
   solid white, and the prescription fills the sheet.
   ========================================================================= */

.portal-main {
  max-width: 800px;
  margin: 40px auto 68px;
  padding: 0 16px;
}

.portal-narrow { max-width: 470px; margin-left: auto; margin-right: auto; }

.portal-card { padding: 30px 28px; margin-bottom: 20px; }

.portal-card h1 { margin: 0 0 10px; font-size: 1.55rem; letter-spacing: -0.024em; }
.portal-card h2 { margin: 0 0 10px; font-size: 1.15rem; }
.portal-muted { color: var(--muted); }
.portal-note  { color: var(--muted); }

/* the patient's own details under the greeting */
.portal-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 0 0 6px;
}
.portal-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-edge);
  color: var(--primary-ink); font-size: 13.5px; font-weight: 700;
}

.portal-error {
  background: rgba(253, 236, 236, 0.92);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid rgba(240, 180, 180, 0.9);
  border-left: 4px solid #C62828;
  color: #8A1F1F;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
}

.portal-form label {
  display: block;
  font-weight: 700;
  margin: 18px 0 7px;
  font-size: 14.5px;
}

.portal-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.portal-form input::placeholder { color: #8496AC; }
.portal-form input:hover { border-color: #B9CCE4; }
.portal-form input:focus {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 99, 214, 0.14);
}

.portal-form button { margin-top: 22px; width: 100%; }

/* ----------------------------------------------------------- visit list */
.visit-list { list-style: none; margin: 0; padding: 0; }

.visit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.visit-row:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glass);
}

.visit-date { font-weight: 800; letter-spacing: -0.012em; }

.visit-labels {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 4px 4px 10px;
  margin-bottom: 2px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
  color: var(--muted);
}
.visit-labels:hover { background: none; transform: none; box-shadow: none; }

.rx-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow);
}

.portal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.rx-note { color: var(--muted); margin: 14px 0; }

@media (max-width: 640px) {
  .visit-row { justify-content: flex-start; }
  .visit-labels { display: none; }
}

/* ------------------------------------------------------------- printing
   The prescription is the point of this page. Everything else - glass,
   shadows, blur, buttons - drops out so the sheet prints clean.        */
@media print {
  html, body { background: #fff !important; }
  body::before { display: none !important; }
  .site-header, .site-footer, .skip-link, .portal-actions, .no-print {
    display: none !important;
  }
  .portal-main { max-width: none; margin: 0; padding: 0; }
  .portal-card {
    background: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border: none; box-shadow: none; padding: 0; margin: 0;
  }
  .visit-row, .portal-chip { background: none; box-shadow: none; border: 0; }
  .rx-img { border: none; border-radius: 0; width: 100%; margin: 0; box-shadow: none; }
  @page { size: A4; margin: 12mm; }
}
