/* Portal pages — matches landing.css dark theme */

h1, h2, h3, h4, h5, h6,
.logo, .form-card h1, .portal-card h2, .plan-card h3 {
  font-family: Montserrat, Inter, system-ui, sans-serif;
}

.portal-page { min-height: 100vh; position: relative; }
.portal-main { padding: 40px 0 64px; position: relative; z-index: 1; }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
  align-items: stretch;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 28px 22px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
  height: 100%;
  min-height: 340px;
}
.portal-card:hover {
  border-color: rgba(249,115,22,0.45);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(249,115,22,0.15);
}
.portal-card.featured {
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 8px 48px rgba(249,115,22,0.2);
}
.portal-card .icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--gradient-btn);
  display: grid; place-items: center; font-size: 1.75rem;
}
.portal-card h2 { font-size: 1rem; font-weight: 700; margin: 14px 0 0; }
.portal-card .portal-desc {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.55;
  max-width: 280px;
  margin: 10px 0 0;
  min-height: 4.65em;
  flex: 1;
}
.portal-card-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.portal-card-footnote {
  min-height: 1.25em;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.portal-card .btn { width: 100%; margin-top: 0; }
.portal-card .btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 28px;
  max-width: 420px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.form-card:hover { box-shadow: 0 8px 32px rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.3); }
.form-card h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.form-card .subtitle { color: var(--muted); font-size: 0.8125rem; margin-bottom: 20px; line-height: 1.5; }
.form-card.wide { max-width: 480px; }

.step-dots { display: flex; align-items: center; gap: 0; margin-bottom: 20px; justify-content: center; }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800; background: rgba(255,255,255,0.1); color: var(--muted); flex-shrink: 0;
}
.step-dot.active { background: var(--gradient-btn); color: #fff; }
.step-dot.done { background: rgba(34,197,94,0.25); color: #86efac; border: 1px solid rgba(34,197,94,0.4); }
.step-line { flex: 1; height: 2px; background: rgba(255,255,255,0.1); min-width: 24px; max-width: 48px; }

.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.field-row-2 .field { margin-bottom: 0; }
@media (max-width: 480px) { .field-row-2 { grid-template-columns: 1fr; } }

.slug-prefix-wrap {
  display: flex; align-items: stretch; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12); background: var(--bg-elevated); overflow: hidden;
}
.slug-prefix-wrap:focus-within { border-color: var(--accent, #F97316); box-shadow: 0 0 0 3px rgba(249,115,22,0.2); }
.slug-prefix {
  padding: 12px 10px; font-size: 0.72rem; color: var(--muted); white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center;
}
.slug-prefix-wrap input { border: none; background: transparent; flex: 1; min-width: 0; }

.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn-row .btn { flex: 1; }

.hours-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-height: 360px; overflow-y: auto; }
.hours-row {
  display: grid; grid-template-columns: 120px 1fr auto 1fr; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.hours-toggle { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; }
.hours-row select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
  background: var(--bg-elevated); color: var(--text); font-size: 0.82rem;
}
.hours-sep { font-size: 0.75rem; color: var(--muted); text-align: center; }

.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.plan-card {
  padding: 16px 14px; border-radius: 12px; text-align: center;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); position: relative;
}
.plan-card.featured { border-color: rgba(249,115,22,0.5); background: rgba(249,115,22,0.12); }
.plan-card h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 6px; }
.plan-price { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; }
.plan-price span { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.plan-desc { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.plan-badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--gradient-btn); color: #fff; font-size: 0.62rem; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
@media (max-width: 600px) {
  .hours-row { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
}

.field { margin-bottom: 18px; text-align: left; }
.field label { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--bg-elevated); color: var(--text);
  font-size: 0.8125rem; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent, #F97316);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.2);
}

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px; width: 100%; box-sizing: border-box; }
.password-toggle {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  width: 34px; height: 34px; border: 1px solid rgba(249,115,22,0.35); border-radius: 8px;
  background: rgba(249,115,22,0.12); color: #e2e8f0; cursor: pointer;
  display: grid; place-items: center; padding: 0; margin: 0; line-height: 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
  color: #fff; background: rgba(249,115,22,0.35);
  border-color: rgba(251,146,60,0.6);
  transform: translateY(-50%) !important;
  -webkit-transform: translateY(-50%) !important;
}
.password-toggle:focus-visible {
  outline: none; color: #fff;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.35);
  border-color: #fb923c;
}
.password-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .icon-hide { display: none; }
.password-toggle.is-visible .icon-show { display: none; }
.password-toggle.is-visible .icon-hide { display: block; }

.field-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.field-row label { margin-bottom: 0; }
.forgot-link {
  font-size: 0.78rem; color: #fb923c; text-decoration: none; font-weight: 600;
}
.forgot-link:hover { text-decoration: underline; color: #fdba74; }

.role-tabs {
  display: flex; gap: 8px; margin-bottom: 24px;
  background: var(--bg-elevated); padding: 6px; border-radius: 12px;
}
.role-tab {
  flex: 1; padding: 12px 16px; border-radius: 10px; border: none;
  background: transparent; color: var(--muted);
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  text-decoration: none; text-align: center; transition: all 0.2s;
}
.role-tab.active, .role-tab:hover {
  background: var(--gradient-btn); color: white;
}

.alert {
  padding: 12px 14px; border-radius: 10px; font-size: 0.85rem; margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-error a { color: #fecaca; font-weight: 700; text-decoration: underline; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-success a { color: #bbf7d0; font-weight: 700; }

.clinic-list { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.clinic-item {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); text-align: left;
}
.clinic-item:hover { border-color: rgba(249,115,22,0.35); }
.clinic-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--gradient-btn); display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.clinic-info { flex: 1; min-width: 0; }
.clinic-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.clinic-info p { color: var(--muted); font-size: 0.82rem; }
.clinic-item .btn { flex-shrink: 0; padding: 10px 18px; font-size: 0.82rem; }

.search-box {
  display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
}
.search-box input {
  flex: 1; padding: 14px 18px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--bg-card); color: var(--text); font-size: 1rem;
}

/* AI Demo chat */
.demo-layout {
  display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start;
}
.chat-panel {
  background: var(--bg-card); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  min-height: 480px;
}
.chat-messages {
  flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
  min-height: 360px; max-height: 420px;
}
.chat-input-row {
  display: flex; gap: 10px; padding: 16px; border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input-row input {
  flex: 1; padding: 12px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12); background: var(--bg-elevated); color: var(--text);
}
.bubble-user {
  align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: 14px;
  background: #065f46; color: #ecfdf5; font-size: 0.88rem;
  border-bottom-right-radius: 4px;
}
.bubble-ai {
  align-self: flex-start; max-width: 85%; padding: 10px 14px; border-radius: 14px;
  background: #1e293b; font-size: 0.88rem; border-bottom-left-radius: 4px;
}
.bubble-meta {
  font-size: 0.72rem; color: var(--muted); margin-top: 4px;
}

.steps-list { list-style: none; margin-top: 20px; }
.steps-list li {
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  color: var(--muted); font-size: 0.9rem; display: flex; gap: 12px;
}
.steps-list li strong { color: var(--text); min-width: 24px; }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 0.88rem; margin-bottom: 24px;
}
.back-link:hover { color: var(--text); }

.btn.is-loading { opacity: 0.75; pointer-events: none; cursor: wait; }

.trial-banner {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.trial-banner strong { display: block; font-size: 0.95rem; margin-bottom: 4px; color: #86efac; }
.trial-banner span { font-size: 0.82rem; color: var(--muted); }

.btn-trial {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  max-height: 48px;
  font-size: 1rem;
}

.plan-note {
  text-align: center;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.plan-note a { color: #fb923c; font-weight: 600; text-decoration: none; }
.plan-note a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .portal-main { padding: 32px 0 56px; }
  .form-card { padding: 24px 20px; max-width: 100%; }
  .form-card.wide { max-width: 100%; }
  .form-card h1 { font-size: 1.3rem; }
}
@media (max-width: 900px) {
  .portal-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
  .portal-card { padding: 24px 20px; min-height: 0; }
  .portal-card .btn {
    width: 100%;
    max-height: 48px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; max-height: 48px; }
  .role-tabs { flex-direction: column; gap: 6px; }
  .role-tab { padding: 10px 14px; font-size: 0.85rem; }
  .step-dots { flex-wrap: wrap; gap: 4px; }
  .step-line { min-width: 16px; max-width: 32px; }
  .search-box { flex-direction: column; }
  .search-box .btn { width: 100%; max-height: 48px; }
  .field input, .field select { padding: 11px 12px; font-size: 16px; }
  .slug-prefix { font-size: 0.65rem; padding: 10px 8px; }
  .alert { font-size: 0.82rem; }
  .nav-inner > .btn {
    padding: 8px 14px;
    font-size: 0.78rem;
    max-height: 40px;
  }
}

@media (max-width: 480px) {
  .portal-main { padding: 24px 0 48px; }
  .form-card { padding: 20px 16px; border-radius: 12px; }
  .back-link { font-size: 0.82rem; margin-bottom: 16px; }
  .hours-list { max-height: 280px; }
  .plan-cards { gap: 8px; }
  .plan-card { padding: 14px 12px; }
  .password-toggle { width: 32px; height: 32px; }
}

@media (max-width: 900px) {
  .demo-layout { grid-template-columns: 1fr; }
  .clinic-item { flex-wrap: wrap; }
  .clinic-item .btn { width: 100%; max-height: 48px; }
}

/* Light mode — portal forms (uses landing.css vars) */
html[data-theme="light"] .portal-page {
  background: #f8fafc;
}
html[data-theme="light"] .portal-page .form-card {
  background: #fff;
  border-color: rgba(15,23,42,0.08);
  box-shadow: 0 2px 12px rgba(15,23,42,0.06);
}
html[data-theme="light"] .portal-page .field input,
html[data-theme="light"] .portal-page .field select {
  background: #fff;
  border-color: rgba(15,23,42,0.12);
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select {
  border-color: rgba(15,23,42,0.12);
  background: #fff;
}
html[data-theme="light"] .portal-card:hover {
  border-color: rgba(249,115,22,0.35);
  box-shadow: var(--shadow-md);
}
html[data-theme="light"] .form-card:hover {
  box-shadow: var(--shadow-md);
}

.portal-card:hover,
.form-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(249,115,22,0.35);
}
