/*
 * GetXtra Hospital Management System: public pages (layouts.app — the home page, sign-in, the patient portal's
 * public pages). Loaded on every one of them through config/registry.php → public_styles (KIT-REQUESTS #37); Kit files
 * stay untouched. The home page's classes are .lp-* (resources/views/pages/home.php, the pattern of POS 1.0.1 / HR
 * 1.0.2); light and dark come from the Kit's tokens. Phase 20a.
 */

.lp-hero {
  text-align: start;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}

.lp-hero-inner {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

@media (min-width: 960px) {
  .lp-hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.lp-hero-text {
  min-width: 0;
}

.lp-hero h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 1.3rem + 3vw, var(--text-5xl));
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lp-hero .lead {
  max-width: 60ch;
  margin: var(--space-5) 0 0;
  color: var(--text-muted);
  font-size: clamp(var(--text-base), 0.95rem + 0.4vw, var(--text-lg));
  line-height: 1.6;
}

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--brand-border, var(--border));
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-text, var(--brand));
  font-size: var(--text-sm);
  font-weight: 600;
}

.lp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-8) 0 0;
}

.lp-hero .hero-actions {
  justify-content: flex-start;
}

.lp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.lp-chips li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.lp-chips .icon {
  color: var(--success);
}

/* ---- the OPD token board drawn in CSS (the hero's picture on a live demo) ---- */
.lp-hero-art {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.lp-board {
  width: min(100%, 390px);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.lp-board-head {
  display: grid;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.lp-board-head strong {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.lp-board-head span,
.lp-board-foot,
.lp-board-label {
  color: var(--text-subtle);
  font-size: var(--text-xs);
}

.lp-board-now {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
}

.lp-board-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lp-board-token {
  color: var(--brand-text, var(--brand));
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1;
}

.lp-board-next {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.lp-board-next li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, var(--radius-lg));
}

.lp-board-next li > span:nth-child(2) {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-board-report {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-strong);
}

.lp-board-report > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
}

.lp-report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: center;
}

.lp-board-foot {
  margin: var(--space-4) 0 0;
  text-align: center;
}

.lp-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.lp-pill-ok {
  background: var(--success-soft);
  color: var(--success);
}

.lp-pill-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.lp-pill-high {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---- sections ---- */
.lp-section {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

.lp-band {
  border-block: 1px solid var(--border);
  background: var(--bg-subtle);
}

.lp-section-head {
  max-width: 720px;
  margin: 0 auto clamp(1.5rem, 1rem + 2vw, 2.75rem);
  text-align: center;
}

.lp-section-head h2 {
  margin: 0;
  font-size: clamp(var(--text-2xl), 1.2rem + 1.6vw, var(--text-4xl));
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lp-section-head p {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
}

.lp-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.lp-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.lp-feature {
  padding: var(--space-6);
  transition: transform var(--duration-fast, 0.15s) ease, box-shadow var(--duration-fast, 0.15s) ease;
}

.lp-feature:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.lp-feature h3,
.lp-who h3,
.lp-steps h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--text-lg);
}

.lp-feature p,
.lp-who p,
.lp-steps p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.lp-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--brand-text, var(--brand));
}

.lp-who {
  min-width: 0;
}

.lp-who > .icon {
  width: 28px;
  height: 28px;
  color: var(--brand-text, var(--brand));
}

.lp-steps {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.lp-steps li {
  position: relative;
  min-width: 0;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.lp-step-no {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--brand-fg, #fff);
  font-family: var(--font-heading);
  font-weight: 700;
}

.lp-faq-wrap {
  max-width: 860px;
}

.lp-faq {
  display: grid;
  gap: var(--space-3);
}

.lp-faq details {
  padding: var(--space-4) var(--space-5);
}

.lp-faq summary {
  font-weight: 600;
  cursor: pointer;
}

.lp-faq details p {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.lp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: clamp(1.5rem, 1rem + 3vw, 3rem);
  border-radius: var(--radius-2xl);
  background: var(--brand-gradient, var(--brand));
  color: var(--brand-fg, #fff);
}

.lp-cta h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(var(--text-2xl), 1.2rem + 1.2vw, var(--text-3xl));
}

.lp-cta p {
  max-width: 56ch;
  margin: var(--space-2) 0 0;
  opacity: 0.92;
}

.lp-cta .lp-actions {
  margin: 0;
}

.lp-cta .btn:not(.btn-primary) {
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  background: transparent;
  color: inherit;
}

.lp-cta .btn-primary {
  background: var(--surface);
  color: var(--brand-text, var(--brand));
}

/* ---- a real site: the doors in ---- */
.lp-doors {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.lp-door {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-6);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--duration-fast, 0.15s) ease, box-shadow var(--duration-fast, 0.15s) ease;
}

.lp-door:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.lp-door > .icon {
  width: 28px;
  height: 28px;
  color: var(--brand-text, var(--brand));
}

.lp-door strong {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.lp-door span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

@media (prefers-reduced-motion: reduce) {
  .lp-feature,
  .lp-feature:hover {
    transform: none;
    transition: none;
  }
}

/* ---- the footer partials and the sign-in card on a phone ---- */
/* The footer partials (the demo sign-ins, "still being prepared") are grid items with min-width: auto, so their widest
   line widened the footer's only column on a phone (Gym K37); a long site name in the footer brand did the same. */
.footer-grid > * {
  min-width: 0;
}

.footer-about .brand,
.footer-about .brand-name {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.auth-card {
  min-width: 0;
  max-width: 100%;
}

/* The demo sign-in boxes (the Kit's [data-demo-logins] in the card, the hospital's [data-hms-demo-logins] below the
   form): the Kit's .alert is a flex row, so ".alert.stack" put the title and every sign-in side by side and a phone's
   page became wider than the screen (KIT-REQUESTS #38). Here they are one under another; long e-mails and buttons wrap. */
.alert.stack[data-demo-logins],
.alert.stack[data-hms-demo-logins] {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  min-width: 0;
}

.alert.stack[data-demo-logins] > *,
.alert.stack[data-hms-demo-logins] > * {
  min-width: 0;
  max-width: 100%;
}

.alert.stack[data-demo-logins] .small,
.alert.stack[data-hms-demo-logins] .small {
  overflow-wrap: anywhere;
}

.alert.stack[data-demo-logins] .btn,
.alert.stack[data-hms-demo-logins] .btn {
  max-width: 100%;
  height: auto;
  padding-block: var(--space-2);
  line-height: 1.25;
  text-align: start;
  white-space: normal;
}

.hms-demo-wrap {
  min-width: 0;
  max-width: 100%;
  margin-block: var(--space-4);
}

.hms-demo-logins {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.hms-demo-logins form {
  min-width: 0;
}

/* ---- classes the views use that the Kit's stylesheets do not define (tests/static/check-css-classes.php) ---- */
.alert-error {
  background: var(--danger-soft);
}

.alert-error > .icon {
  color: var(--danger);
}

.alert-info {
  background: var(--info-soft, var(--brand-soft));
}

.alert-info > .icon {
  color: var(--info, var(--brand));
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.input-sm,
.select-sm {
  min-height: 2rem;
  padding-block: var(--space-1);
  font-size: var(--text-sm);
}

.stack-sm {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pre-line {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* the portal's privacy footer (resources/views/hms/partials/officer.php) */
.hms-portal-officer {
  overflow-wrap: anywhere;
}

/* the account's privacy page: a consent purpose per row */
.fs-row {
  min-width: 0;
  overflow-wrap: anywhere;
}
