/* ============================================================
   Cross-surface components
   ============================================================
   Small primitives shared by patient intake, clinic/account setup,
   console authentication, and the public demo. Surface-specific chrome
   belongs in intake.css, clinic.css, or the admin sheets — never here.

   Depends on: tokens.css, base.css (loaded first)
   ============================================================ */

/* ── Link defaults ──
   Unstyled anchors (disclaimer copy, consent labels, clinic notices) must
   not fall back to the UA blue, which is near-invisible on the dark theme.
   Component and surface selectors intentionally override this low-specificity
   default (admin-layout.css supplies the console's darker link token). */
a {
  color: var(--color-primary);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ── Hero header ──
   Shared by patient completion, console login, and all MFA pages. */
.hero-header {
  background: var(--gradient-hero);
  padding: 48px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2314b8a6' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-icon {
  width: 72px;
  height: 72px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-lg);
}

.hero-icon svg {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ── Chat transcript bubbles ──
   The patient chat and the public demo use the same message vocabulary.
   messageSlide is part of the contract: demo-cinema.js reveals pre-built
   bubbles by clearing `hidden`, which restarts this animation. */
.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.5;
  animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.message-assistant {
  background: var(--bg-primary);
  color: var(--text-primary);
  align-self: flex-start;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: var(--radius-sm);
}

/* ── Shared forms ──
   Used by patient walk-in registration, clinic new-intake/consult/setup,
   and console detail/sampler forms. */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  /* 11px vertical → ≈44px control height (tap-target guideline; the audit
     tooling flags anything under 44px on mobile). */
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

/* ── Account setup (demo GP onboarding, clinic/setup.html) ── */
.setup-page {
  padding-top: 40px;
}

.setup-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.setup-brand .audri-mark {
  font-size: 2.25rem;
}

.setup-brand-name {
  font-family: var(--font-display, var(--font-sans));
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Small policy checklist rendered inside a field's footer, so the rules
   are visible up front rather than discovered by failing validation. */
.field-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.field-hint-title {
  margin: 0 0 4px;
  font-weight: 600;
}

.field-hint-list {
  margin: 0;
  padding-left: 1.1rem;
}

.field-hint-list li {
  margin: 2px 0;
}

/* Multi-error list inside an alert. */
.alert-list {
  margin: 6px 0 0;
  padding-left: 1.2rem;
}

.alert-list li {
  margin: 2px 0;
}

@media (max-width: 480px) {
  .hero-header {
    padding: 36px 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .message {
    max-width: 90%;
  }
}
