:root {
  color-scheme: light;
  --ink: #17324a;
  --muted: #64798b;
  --line: rgba(42, 82, 108, 0.16);
  --panel: rgba(255, 255, 255, 0.94);
  --navy: #0e2942;
  --blue: #176d87;
  --teal: #2f9f92;
  --cream: #f8f4ea;
  --gold: #e4b85f;
  --danger: #a43b47;
  --danger-bg: #fff2f3;
  --shadow: 0 34px 80px rgba(5, 30, 48, 0.24), 0 10px 28px rgba(5, 30, 48, 0.11);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(130, 222, 218, 0.34), transparent 31rem),
    radial-gradient(circle at 93% 89%, rgba(228, 184, 95, 0.20), transparent 27rem),
    linear-gradient(135deg, #0b263f 0%, #15536b 50%, #287e7b 100%);
}

button, input { font: inherit; }
a { color: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(420px, 0.86fr);
  overflow: hidden;
}

.welcome-panel {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 72px);
  color: #f7fbfc;
  overflow: hidden;
}

.welcome-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.welcome-panel::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 640px;
  height: 640px;
  right: -255px;
  bottom: -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 68%);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand, .mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #0e3b52;
  background: linear-gradient(145deg, #fffdf5, #b8ebe4);
  box-shadow: 0 12px 28px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.86);
}

.brand-mark svg { width: 29px; height: 29px; }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 1.28rem; font-weight: 720; letter-spacing: -.025em; }

.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.23);
  border-radius: 999px;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(14px);
  font-size: .82rem;
}

.secure-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #88e3c1;
  box-shadow: 0 0 0 5px rgba(136,227,193,.12);
}

.welcome-copy {
  position: relative;
  z-index: 2;
  max-width: 690px;
  margin-top: clamp(70px, 11vh, 145px);
}

.eyebrow, .card-kicker {
  margin: 0 0 15px;
  font-size: .74rem;
  font-weight: 760;
  letter-spacing: .19em;
}

.eyebrow { color: #aee4dc; }

.welcome-copy h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(2.75rem, 5vw, 5.35rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 670;
  text-wrap: balance;
}

.welcome-lead {
  max-width: 600px;
  margin: 28px 0 0;
  color: rgba(247,251,252,.78);
  font-size: clamp(1.03rem, 1.4vw, 1.25rem);
  line-height: 1.7;
}

.role-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  max-width: 860px;
  margin-top: clamp(40px, 6vh, 72px);
}

.role-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  min-height: 122px;
  padding: 19px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 22px;
  background: rgba(255,255,255,.075);
  backdrop-filter: blur(16px);
}

.role-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff7df;
  background: rgba(228,184,95,.18);
  font-size: 1.1rem;
}

.role-card h2 { margin: 2px 0 7px; font-size: .92rem; font-weight: 700; }
.role-card p { margin: 0; color: rgba(247,251,252,.67); font-size: .78rem; line-height: 1.5; }

.ambient-visual { position: absolute; z-index: 0; inset: 0; pointer-events: none; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.orbit-one { width: 510px; height: 510px; right: -155px; top: 18%; }
.orbit-two { width: 360px; height: 360px; right: -80px; top: 26%; border-style: dashed; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); }
.orb-large { width: 120px; height: 120px; right: 62px; top: 31%; background: linear-gradient(145deg, rgba(173,235,226,.58), rgba(255,255,255,.05)); box-shadow: 0 35px 90px rgba(1,28,42,.32); }
.orb-small { width: 27px; height: 27px; right: 254px; top: 24%; background: #e6bd69; box-shadow: 0 0 36px rgba(230,189,105,.48); }

.floating-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 17px;
  background: rgba(9,45,63,.42);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 45px rgba(0,0,0,.14);
}

.floating-tile span { font-size: 1.13rem; font-weight: 720; }
.floating-tile small { color: rgba(255,255,255,.62); font-size: .68rem; letter-spacing: .04em; }
.tile-one { right: 16%; top: 20%; transform: rotate(3deg); }
.tile-two { right: 3%; top: 53%; transform: rotate(-4deg); }
.tile-three { right: 28%; bottom: 15%; transform: rotate(2deg); }

.welcome-footnote {
  position: relative;
  z-index: 2;
  margin: auto 0 0;
  padding-top: 34px;
  color: rgba(255,255,255,.56);
  font-size: .82rem;
}

.form-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 100% 0%, rgba(74,171,156,.12), transparent 22rem),
    linear-gradient(165deg, rgba(255,255,255,.98), rgba(248,244,234,.96));
}

.form-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.5), transparent);
}

.login-card {
  width: min(100%, 480px);
  padding: clamp(29px, 4vw, 47px);
  border: 1px solid rgba(255,255,255,.86);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.mobile-brand { display: none; color: var(--ink); margin-bottom: 31px; }
.card-kicker { color: var(--teal); }
.login-card h2 { margin: 0; color: var(--ink); font-size: clamp(2rem, 3vw, 2.65rem); letter-spacing: -.045em; font-weight: 690; }
.card-intro { margin: 15px 0 30px; color: var(--muted); line-height: 1.65; font-size: .96rem; }

.flash-stack { display: grid; gap: 9px; margin: 0 0 22px; }
.flash-message {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid rgba(164,59,71,.21);
  border-radius: 14px;
  color: #80323d;
  background: var(--danger-bg);
  font-size: .88rem;
  line-height: 1.45;
}
.flash-symbol { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-size: .72rem; font-weight: 800; }

.login-form { display: grid; gap: 20px; }
.field-group { display: grid; gap: 8px; }
.label-row { display: flex; justify-content: space-between; gap: 12px; }
.field-group label { color: #2a4357; font-size: .86rem; font-weight: 680; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248,251,251,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input-wrap:focus-within {
  border-color: rgba(47,159,146,.65);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47,159,146,.12), inset 0 1px 0 rgba(255,255,255,.9);
}

.field-icon { width: 50px; display: grid; place-items: center; color: #78909d; }
.field-icon svg { width: 20px; height: 20px; }
.field-icon path, .field-icon rect { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.input-wrap input {
  min-width: 0;
  flex: 1;
  height: 56px;
  padding: 0 15px 0 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
}
.input-wrap input::placeholder { color: #9aabb6; }
.password-wrap input { padding-right: 4px; }

.password-toggle {
  align-self: stretch;
  min-width: 67px;
  margin: 5px;
  border: 0;
  border-radius: 12px;
  color: #346878;
  background: rgba(47,159,146,.09);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 720;
}
.password-toggle:hover { background: rgba(47,159,146,.15); }
.password-toggle:focus-visible { outline: 3px solid rgba(47,159,146,.28); outline-offset: 1px; }

.primary-button {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 3px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(115deg, #145d79, #258d88);
  box-shadow: 0 14px 28px rgba(22,105,121,.24), inset 0 1px 0 rgba(255,255,255,.24);
  cursor: pointer;
  font-weight: 760;
  letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(22,105,121,.28), inset 0 1px 0 rgba(255,255,255,.24); filter: saturate(1.06); }
.primary-button:focus-visible { outline: 4px solid rgba(47,159,146,.22); outline-offset: 3px; }
.primary-button:disabled { cursor: wait; transform: none; opacity: .86; }
.button-arrow { font-size: 1.2rem; transition: transform .18s ease; }
.primary-button:hover .button-arrow { transform: translateX(3px); }
.button-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.38); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.primary-button.is-loading .button-arrow { display: none; }
.primary-button.is-loading .button-spinner { display: block; }

.account-help { margin-top: 27px; text-align: center; }
.account-help p { margin: 0; color: #617685; font-size: .88rem; }
.account-help a { color: #176b7b; font-weight: 720; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.support-copy { margin-top: 12px !important; font-size: .78rem !important; line-height: 1.5; }

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 19px;
  margin-top: 27px;
  padding-top: 20px;
  border-top: 1px solid rgba(42,82,108,.11);
  color: #758895;
  font-size: .72rem;
}
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row i { width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #217c70; background: rgba(47,159,146,.12); font-style: normal; font-size: .68rem; font-weight: 800; }

.page-footer { margin: 25px 0 0; color: rgba(23,50,74,.54); text-align: center; font-size: .77rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 0%,100% { transform: translate3d(0,0,0) rotate(3deg); } 50% { transform: translate3d(0,-10px,0) rotate(1deg); } }
@keyframes drift-reverse { 0%,100% { transform: translate3d(0,0,0) rotate(-4deg); } 50% { transform: translate3d(0,9px,0) rotate(-2deg); } }

@media (min-width: 1081px) {
  .tile-one { animation: drift 7s ease-in-out infinite; }
  .tile-two { animation: drift-reverse 8.5s ease-in-out infinite; }
  .tile-three { animation: drift 9.2s ease-in-out infinite .8s; }
}

@media (max-width: 1180px) {
  .login-shell { grid-template-columns: minmax(0, .98fr) minmax(410px, 1.02fr); }
  .role-grid { grid-template-columns: 1fr; max-width: 470px; }
  .role-card { min-height: auto; }
  .ambient-visual { opacity: .62; }
}

@media (max-width: 900px) {
  body { background: linear-gradient(145deg, #0d3049, #277e78); }
  .login-shell { display: block; min-height: 100vh; padding: 22px; }
  .welcome-panel { display: none; }
  .form-panel { min-height: calc(100vh - 44px); padding: 24px; border-radius: 30px; }
  .form-panel::before { display: none; }
  .mobile-brand { display: inline-flex; }
  .login-card { width: min(100%, 520px); }
}

@media (max-width: 520px) {
  .login-shell { padding: 0; }
  .form-panel { min-height: 100vh; justify-content: flex-start; padding: 27px 18px 22px; border-radius: 0; }
  .login-card { padding: 28px 21px; border-radius: 24px; box-shadow: 0 18px 55px rgba(5,30,48,.18); }
  .login-card h2 { font-size: 2rem; }
  .card-intro { margin-bottom: 25px; }
  .page-footer { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
