:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-ink: #10233f;
  --auth-muted: #66758a;
  --auth-line: #dce6ed;
  --auth-surface: rgba(255, 255, 255, .94);
  --auth-navy: #0b2745;
  --auth-teal: #0f766e;
  --auth-teal-dark: #0b5e58;
  --auth-soft: #edf6f5;
  --auth-focus: rgba(15, 118, 110, .14);
  --auth-shadow: 0 28px 90px rgba(7, 32, 56, .16);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #eef4f7; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--auth-ink);
  background: #eef4f7;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr);
}

.auth-story {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(38px, 5.4vw, 76px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 18%, rgba(90, 214, 192, .28), transparent 25%),
    radial-gradient(circle at 12% 88%, rgba(255, 196, 104, .18), transparent 23%),
    linear-gradient(145deg, #081f38 0%, #0b3e50 55%, #0e716a 100%);
}

.auth-story::before,
.auth-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
}

.auth-story::before { width: 430px; height: 430px; right: -190px; top: -160px; }
.auth-story::after { width: 250px; height: 250px; left: -100px; bottom: -100px; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.025em;
  text-decoration: none;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 13px;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  backdrop-filter: blur(12px);
  font-size: 13px;
  letter-spacing: -.04em;
}

.auth-story-copy { max-width: 670px; }
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #a7efe4;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.auth-kicker::before { content: ""; width: 24px; height: 1px; background: currentColor; }

.auth-story h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: .98;
  letter-spacing: -.058em;
}

.auth-story-copy > p {
  max-width: 590px;
  margin: 22px 0 0;
  color: rgba(235, 252, 249, .78);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.7;
}

.auth-preview {
  width: min(590px, 100%);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 22px;
  background: rgba(255, 255, 255, .09);
  box-shadow: 0 24px 55px rgba(2, 21, 35, .2);
  backdrop-filter: blur(16px);
}

.auth-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 4px 13px; }
.auth-preview-head span { color: rgba(255, 255, 255, .76); font-size: 12px; font-weight: 750; }
.auth-preview-dots { display: flex; gap: 5px; }
.auth-preview-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .35); }

.auth-preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.preview-card {
  min-width: 0;
  padding: 15px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .94);
  color: var(--auth-ink);
}
.preview-card.wide { grid-column: span 2; }
.preview-label { display: block; overflow: hidden; color: #718096; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.preview-card strong { display: block; margin-top: 7px; font-size: 22px; letter-spacing: -.035em; }
.preview-card small { display: block; margin-top: 3px; color: #0f766e; font-size: 9px; font-weight: 850; }
.preview-chart { height: 49px; display: flex; align-items: end; gap: 6px; margin-top: 9px; }
.preview-chart i { flex: 1; min-width: 6px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #42b7a9, #0f766e); }
.preview-chart i:nth-child(1) { height: 35%; }.preview-chart i:nth-child(2) { height: 55%; }.preview-chart i:nth-child(3) { height: 47%; }.preview-chart i:nth-child(4) { height: 72%; }.preview-chart i:nth-child(5) { height: 64%; }.preview-chart i:nth-child(6) { height: 91%; }

.auth-trust { display: flex; flex-wrap: wrap; gap: 9px; }
.auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
  font-weight: 750;
}
.auth-trust svg { width: 14px; height: 14px; }

.auth-form-side {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
  background:
    radial-gradient(circle at 92% 5%, rgba(87, 190, 177, .12), transparent 24%),
    linear-gradient(180deg, #f8fbfc, #edf3f6);
}

.auth-form-side::after {
  content: "";
  position: absolute;
  right: 7%;
  bottom: 7%;
  width: 80px;
  height: 80px;
  opacity: .35;
  background-image: radial-gradient(#87aaa7 1px, transparent 1px);
  background-size: 10px 10px;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
  padding: clamp(27px, 4vw, 42px);
  border: 1px solid rgba(207, 221, 230, .9);
  border-radius: 26px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(18px);
}

.auth-role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 27px;
  padding: 5px;
  border-radius: 14px;
  background: #edf2f5;
}

.auth-role-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #738094;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.auth-role-picker button:hover { color: var(--auth-teal); }
.auth-role-picker button[aria-pressed="true"] { color: var(--auth-teal); background: #fff; box-shadow: 0 5px 18px rgba(15, 35, 63, .09); }
.auth-role-picker button:focus-visible { outline: 3px solid var(--auth-focus); }
.auth-role-picker svg { flex: 0 0 auto; width: 15px; height: 15px; }

.auth-eyebrow { color: var(--auth-teal); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h2 { margin: 10px 0 8px; font-size: clamp(28px, 4vw, 34px); line-height: 1.12; letter-spacing: -.04em; }
.auth-subtitle { min-height: 48px; margin: 0 0 24px; color: var(--auth-muted); font-size: 14px; line-height: 1.65; }

.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  padding: 12px 13px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.auth-notice svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.auth-notice.error { color: #9f1f28; border-color: #fecdd0; background: #fff1f2; }
.auth-notice.success { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }

.auth-form { display: grid; gap: 17px; }
.auth-field { display: grid; gap: 7px; }
.auth-field > label { font-size: 12px; font-weight: 850; }
.auth-input-wrap { position: relative; }
.auth-input-wrap > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; color: #8290a0; pointer-events: none; transform: translateY(-50%); }
.auth-input-wrap input {
  width: 100%;
  min-height: 50px;
  padding: 12px 46px 12px 43px;
  border: 1px solid #cbd9e3;
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, .9);
  color: var(--auth-ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-input-wrap input::placeholder { color: #a0abba; }
.auth-input-wrap input:focus { border-color: var(--auth-teal); background: #fff; box-shadow: 0 0 0 4px var(--auth-focus); }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #768598;
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { color: var(--auth-teal); background: var(--auth-soft); }
.password-toggle:focus-visible { outline: 3px solid var(--auth-focus); }
.password-toggle svg { width: 18px; height: 18px; }

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  margin-top: 3px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-navy), #0d4c59);
  box-shadow: 0 12px 24px rgba(11, 39, 69, .2);
  cursor: pointer;
  font-weight: 850;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(11, 39, 69, .25); filter: brightness(1.05); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:focus-visible { outline: 4px solid var(--auth-focus); outline-offset: 2px; }
.auth-submit svg { width: 18px; height: 18px; }
.auth-submit[aria-busy="true"] { cursor: wait; opacity: .78; }

.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 12px; }
.auth-links a { color: var(--auth-teal); font-weight: 800; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; color: #8390a0; font-size: 10px; line-height: 1.5; text-align: center; }
.auth-footnote svg { width: 13px; height: 13px; }

.auth-shell[data-variant="admin"] { --auth-teal: #176b87; --auth-teal-dark: #0f4b61; --auth-focus: rgba(23, 107, 135, .14); }
.auth-shell[data-variant="admin"] .auth-story { background: radial-gradient(circle at 82% 15%, rgba(165, 215, 232, .28), transparent 24%), linear-gradient(145deg, #071a33 0%, #0b2447 54%, #176b87 100%); }
.auth-admin-seal { display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 22px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.auth-admin-seal svg { width: 30px; height: 30px; }
.admin-security-list { display: grid; gap: 10px; width: min(540px, 100%); }
.admin-security-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.78); font-size: 12px; font-weight: 700; }
.admin-security-item svg { flex: 0 0 auto; width: 17px; height: 17px; color: #a5d7e8; }

@media (max-width: 930px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 360px; padding: 34px clamp(24px, 7vw, 60px); }
  .auth-story h1 { max-width: 740px; font-size: clamp(38px, 7vw, 58px); }
  .auth-preview { display: none; }
  .auth-form-side { min-height: 650px; }
  .auth-trust, .admin-security-list { margin-top: 8px; }
}

@media (max-width: 600px) {
  .auth-story { min-height: 285px; gap: 28px; }
  .auth-story-copy > p { font-size: 14px; line-height: 1.55; }
  .auth-trust span:nth-child(n+3), .admin-security-item:nth-child(n+3) { display: none; }
  .auth-form-side { min-height: auto; padding: 18px 14px 34px; }
  .auth-card { margin-top: -30px; padding: 26px 20px; border-radius: 22px; }
  .auth-role-picker button { font-size: 10px; }
  .auth-subtitle { min-height: 0; }
  .auth-links { align-items: flex-start; flex-direction: column; gap: 11px; }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-card { animation: auth-card-in .55s cubic-bezier(.2,.8,.2,1) both; }
  .auth-preview { animation: auth-preview-in .7s .1s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes auth-card-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes auth-preview-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
}
