/* ===== Texas Health MyChart — Unified design system ===== */
:root {
  /* brand */
  --navy: #003798;
  --navy-700: #00296e;
  --navy-100: #e8eefc;
  --blue: #0072c6;
  --teal: #00a4a0;
  --green: #007a33;
  --green-600: #00642a;
  --red: #b3261e;
  --red-bg: #f8dedd;
  --green-bg: #e8f4ec;
  /* neutrals */
  --ink: #16304a;
  --ink-soft: #33475b;
  --muted: #697386;
  --muted-2: #8a94a6;
  --line: #d8dee7;
  --line-strong: #a9b0ba;
  --surface: #ffffff;
  --canvas: linear-gradient(180deg, #eef2f7 0%, #e7ecf2 100%);
  /* type */
  --font: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  /* radius + shadow */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-card: 0 1px 2px rgba(16,32,64,.04), 0 12px 32px rgba(16,32,64,.10), 0 2px 6px rgba(16,32,64,.06);
  --shadow-focus: 0 0 0 3px rgba(0,55,152,.14);
  --ease: cubic-bezier(.16,1,.3,1);
  /* motion */
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-soft: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* page shell — real photo backdrop (blurred) like the live portal */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.5rem 2rem;
  position: relative;
  background:
    linear-gradient(180deg, rgba(238,242,247,.86), rgba(231,236,242,.92)),
    url('/images/prelogin_blurred.jpg') center center / cover no-repeat fixed;
}
.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%);
  pointer-events: none;
  z-index: 0;
}
.shell > * { position: relative; z-index: 1; }
.shell--top { justify-content: flex-start; padding-top: 2.5rem; }

/* brand lockup */
.brand { text-align: center; margin-bottom: 1.5rem; }
.brand img { height: 44px; max-width: 240px; display: block; margin: 0 auto; }
.brand .tag { font-size: .8rem; color: var(--muted-2); margin-top: .3rem; }

/* card */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid rgba(16,32,64,.05);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 2.75rem;
}
.card--wide { max-width: 480px; }

/* headings */
.h1 { font-size: 1.32rem; font-weight: 600; color: var(--ink); margin: 0 0 .4rem; text-align: center; }
.lead { font-size: .9rem; color: var(--muted); line-height: 1.55; text-align: center; margin: 0 0 1.6rem; }
.lead b { color: var(--ink-soft); }

/* icon badge */
.badge {
  width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #0052b8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 4px 14px rgba(0,55,152,.28);
}
.badge svg { width: 27px; height: 27px; }

/* fields */
.field { margin-bottom: 1.05rem; text-align: left; }
.field label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .32rem; }
.input {
  width: 100%; padding: .78rem .9rem;
  font-size: .98rem; font-family: var(--font); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  outline: none; background: #fff;
  transition: border-color .2s var(--ease-soft), box-shadow .2s var(--ease-soft);
}
.input:hover { border-color: #7a838e; }
.input:focus { border-color: var(--navy); box-shadow: var(--shadow-focus); }
.input--icon { padding-left: 2.5rem; }
.input-wrap { position: relative; }
.input-wrap .ic {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted-2); pointer-events: none;
}
.eye {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted-2);
  padding: .3rem; border-radius: 6px; display: flex;
}
.eye:hover { color: var(--ink-soft); background: var(--navy-100); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: .82rem 1rem;
  font-size: 1rem; font-weight: 600; font-family: var(--font);
  color: #fff; background: linear-gradient(180deg, #0a4bb5 0%, #003798 100%); border: none; border-radius: var(--r-sm);
  cursor: pointer; text-decoration: none; letter-spacing: .2px;
  box-shadow: 0 1px 2px rgba(0,40,90,.2);
  transition: background .18s var(--ease-soft), transform .12s var(--ease-soft), box-shadow .18s;
}
.btn:hover:not(:disabled) { background: var(--navy-700); box-shadow: 0 2px 8px rgba(0,40,90,.26); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn--green { background: var(--green); box-shadow: 0 1px 2px rgba(0,60,30,.2); }
.btn--green:hover:not(:disabled) { background: var(--green-600); }
.btn--ghost {
  background: none; color: var(--blue); font-weight: 600; box-shadow: none; padding: .6rem;
}
.btn--ghost:hover:not(:disabled) { background: var(--navy-100); box-shadow: none; }
.btn .spin {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; margin-right: 8px;
  animation: spin .7s linear infinite; vertical-align: -2px;
}

/* alerts */
.alert {
  display: none; align-items: flex-start; gap: .55rem;
  padding: .8rem .95rem; border-radius: 9px; font-size: .86rem; line-height: 1.5;
  margin-bottom: 1.15rem; text-align: left;
}
.alert.show { display: flex; animation: fadeDown .4s var(--ease) both; }
.alert .ic { flex-shrink: 0; font-weight: 700; }
.alert--error { background: var(--red-bg); color: var(--red); border: 1px solid #f0cdcf; }
.alert--success { background: var(--green-bg); color: #0b6b33; border: 1px solid #c6e5d0; }

/* links */
.link-row { display: flex; justify-content: space-between; margin-top: 1.15rem; font-size: .85rem; }
.link-row a { color: var(--blue); text-decoration: none; transition: color .15s; }
.link-row a:hover { color: var(--navy); text-decoration: underline; }

/* status / loader */
.status { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 1.6rem 0 .6rem; }
.status .ring {
  width: 36px; height: 36px; border: 3px solid rgba(0,55,152,.15);
  border-top-color: var(--navy); border-radius: 50%; animation: spin .75s linear infinite;
}
.status .txt { font-size: .88rem; color: var(--muted); text-align: center; transition: opacity .3s; }

/* footer */
.foot { margin-top: 2rem; font-size: .75rem; color: var(--muted-2); text-align: center; line-height: 1.7; }
.foot a { color: var(--muted-2); }

/* views */
.view { display: none; }
.view.active { display: block; animation: fadeUp .42s var(--ease) both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.9); } 60% { transform: scale(1.03); } 100% { opacity: 1; transform: scale(1); } }

/* progress steps */
.steps { display: flex; align-items: center; gap: .5rem; justify-content: center; margin-bottom: 1.5rem; }
.steps .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: background .4s var(--ease-soft), transform .4s var(--ease); }
.steps .dot.on { background: var(--navy); transform: scale(1.25); }
.steps .dot.done { background: var(--green); }
.steps .bar { width: 22px; height: 2px; border-radius: 1px; background: var(--line); transition: background .4s var(--ease-soft); }
.steps .bar.on { background: var(--green); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) { .card { padding: 2rem 1.4rem; } }