/* InnoPair Health — onboarding layout (onboard.html) */

.auth-shell {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  min-height: 100vh;
}

/* Context panel */
.auth-aside {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  background: var(--slate-900);
  color: var(--slate-300);
}
.auth-aside .brand { margin-bottom: var(--space-8); }
.auth-aside .brand-name { color: var(--white); }
.auth-aside .brand-qualifier { color: #60a5fa; }
.auth-aside h1 { color: var(--white); font-size: var(--text-2xl); }
.auth-aside p { color: var(--slate-300); }
.auth-notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: auto 0 0;
  padding: var(--space-6) 0 0;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  list-style: none;
  font-size: var(--text-sm);
}
.auth-notes li { position: relative; padding-left: var(--space-6); color: var(--slate-300); }
.auth-notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* Form column */
.auth-main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
}
.step-progress {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.auth-card {
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.auth-card h2 { margin-bottom: var(--space-2); font-size: var(--text-xl); }
.auth-card .lede { margin-bottom: var(--space-6); color: var(--text-muted); font-size: var(--text-sm); }
.signin-row { margin-top: var(--space-5); font-size: var(--text-sm); text-align: center; }
.signin-row a { font-weight: 600; text-decoration: none; }
.signin-row a:hover { text-decoration: underline; }

/* Selectable cards */
.role-grid,
.provider-list,
.consent-list { display: flex; flex-direction: column; gap: var(--space-3); }
.provider-list { margin-bottom: var(--space-4); }

.role-card,
.provider-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.role-card:hover,
.provider-card:hover { border-color: var(--slate-400); }
.role-card.selected,
.provider-card.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.role-card strong { font-size: var(--text-base); font-weight: 600; }
.provider-card { font-size: var(--text-sm); font-weight: 600; }
.provider-card small { font-weight: 400; }
.role-card small,
.provider-card small { color: var(--text-body); font-size: var(--text-sm); line-height: var(--leading-normal); }
.role-card .role-check {
  position: absolute;
  top: var(--space-4);
  right: var(--space-5);
  display: none;
  align-items: center;
  gap: var(--space-1);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 600;
}
.role-card.selected .role-check { display: flex; }
.role-card.selected strong { padding-right: 5.5rem; }

/* Fields */
.field { margin-bottom: var(--space-5); }
.field-title { margin-bottom: var(--space-3); color: var(--text); font-size: var(--text-sm); font-weight: 600; }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: #dc2626; }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgb(220 38 38 / 0.2); }
.field-help { margin-top: var(--space-1); color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-normal); }
.field-error { min-height: 1.25rem; margin-top: var(--space-1); color: #b91c1c; font-size: var(--text-sm); font-weight: 500; }
.field-error:empty { min-height: 0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 var(--space-4); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.form-actions .back-button { margin-right: auto; }
.form-actions .primary-button,
.form-actions .back-button { min-height: 2.75rem; padding: 0 var(--space-5); }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6rem;
  margin: var(--space-3) 0 0;
  padding: var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-hover); }
.dropzone.has-file { border-style: solid; border-color: var(--success-border); background: var(--success-soft); color: var(--success); }

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}
.consent-item:has(input:checked) { border-color: var(--primary-border); background: var(--primary-soft); }
.consent-item input { margin-top: 0.15rem; }
p.consent-item { background: var(--surface-muted); cursor: default; }
.consent-item strong { display: block; color: var(--text); font-weight: 600; }
.consent-item span span { display: block; margin-top: 2px; color: var(--text-muted); font-weight: 400; }

.review-list { border: 1px solid var(--border); border-radius: var(--radius); }
.review-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}
.review-row + .review-row { border-top: 1px solid var(--border); }
.review-row span:first-child { color: var(--text-muted); }
.review-row span:last-child { color: var(--text); font-weight: 600; text-align: right; text-transform: capitalize; }

/* Sign up / sign in segmented control */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  padding: var(--space-1);
  border-radius: var(--radius);
  background: var(--slate-100);
}
.auth-tabs .primary-button,
.auth-tabs .back-button { min-height: 2.25rem; border-color: transparent; }
.auth-tabs .primary-button { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-tabs .back-button { background: transparent; color: var(--text-muted); }
.auth-tabs .back-button:hover { color: var(--text); }

/* FinchNode hosted-consent overlay */
.finch-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgb(15 23 42 / 0.45);
}
.finch-overlay[hidden] { display: none !important; }
.finch-frame {
  width: min(480px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.finch-frame h2 { margin: var(--space-2) 0; font-size: var(--text-xl); }
.finch-frame > p:not(.eyebrow) { margin-bottom: var(--space-6); color: var(--text-muted); font-size: var(--text-sm); }
.finch-frame .provider-list { gap: var(--space-2); }
.finch-frame .consent-item { padding: var(--space-3) var(--space-4); }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { position: static; height: auto; padding: var(--space-6) var(--space-4); }
  .auth-aside .brand { margin-bottom: var(--space-4); }
  .auth-aside h1 { font-size: var(--text-xl); }
  .auth-notes { margin-top: var(--space-2); padding-top: var(--space-4); font-size: var(--text-xs); }
  .auth-main { padding: var(--space-6) var(--space-4) var(--space-10); }
  .auth-card { padding: var(--space-6) var(--space-5); }
}

/* Sample accounts on the sign-in screen */
.demo-accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-bottom: var(--space-5); }
.demo-accounts .field-help { grid-column: 1 / -1; margin: 0 0 var(--space-1); }
.demo-accounts code { padding: 0 var(--space-1); border-radius: 4px; background: var(--slate-100); color: var(--text); font-size: var(--text-xs); }
.demo-account {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.demo-account:hover:not(:disabled) { border-color: var(--slate-400); }
.demo-account:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.demo-account:disabled { cursor: progress; opacity: 0.55; }
.demo-account.signing-in { opacity: 1; border-color: var(--primary); background: var(--primary-soft); }
.demo-account strong { display: block; overflow: hidden; font-size: var(--text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.demo-account small { display: block; color: var(--text-muted); font-size: var(--text-xs); }
.demo-avatar { display: grid; flex: none; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: var(--text-xs); font-weight: 700; }
@media (max-width: 520px) { .demo-accounts { grid-template-columns: 1fr; } }

.signin-otter { display: block; width: 72px; height: auto; margin-bottom: var(--space-2); animation: signin-wave 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes signin-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg) translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .signin-otter { animation: none; } }
