:root {
  --brand-600: #0d756d;
  --brand-700: #0d5f59;
  --brand-900: #102f30;
  --ink: #142526;
  --muted: #5e6e6f;
  --canvas: #eef3f1;
  --surface: #ffffff;
  --border: #d8e1df;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #087f5b;
  --success-soft: #eaf7f2;
  --shadow: 0 24px 80px rgba(16, 47, 48, 0.14);
  --font: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit; }
button, input { min-height: 44px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-panel, .auth-card, .auth-view, form { min-width: 0; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(440px, 0.92fr);
  min-height: 100dvh;
}

.brand-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(42px, 6vw, 86px);
  background: var(--brand-900);
  color: #fff;
}
.brand-panel::after {
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 64px rgba(255, 255, 255, 0.025), 0 0 0 128px rgba(255, 255, 255, 0.02);
  content: "";
  pointer-events: none;
}
.brand-lockup, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-lockup img, .mobile-brand img { border-radius: 12px; }
.brand-copy { max-width: 680px; margin: clamp(48px, 9vh, 112px) 0 44px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-700);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.brand-panel .eyebrow { color: #8fd2cb; }
.brand-copy h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5.25rem);
  font-weight: 780;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
}
.brand-description {
  max-width: 580px;
  margin: 28px 0 0;
  color: #bed0cf;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
}
.trust-list {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 720px;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  list-style: none;
}
.trust-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.trust-list li > span { color: #8fd2cb; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.trust-list b, .trust-list small { display: block; }
.trust-list b { font-size: 0.95rem; }
.trust-list small { margin-top: 3px; color: #aebfbe; font-size: 0.78rem; }
.brand-footnote { position: relative; z-index: 1; margin: 30px 0 0; color: #8fa3a2; font-size: 0.75rem; }

.auth-panel {
  display: grid;
  place-content: center;
  width: 100%;
  padding: 48px;
  background: var(--canvas);
}
.mobile-brand { display: none; }
.auth-card {
  width: min(100%, 460px);
  max-width: 100%;
  padding: 42px;
  border: 1px solid rgba(216, 225, 223, 0.9);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-heading { margin-bottom: 28px; }
.auth-heading h2 {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 2.3rem);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.08;
}
.auth-heading > p:last-child { margin: 11px 0 0; color: var(--muted); font-size: 0.92rem; }
form { display: grid; gap: 10px; }
label, .label-row { font-size: 0.78rem; font-weight: 750; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fbfcfc;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
input:hover { border-color: #a8bbb8; background: #fff; }
input:focus { border-color: var(--brand-600); background: #fff; box-shadow: 0 0 0 4px rgba(13, 117, 109, 0.14); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 96px; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.text-link, .back-button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--brand-700);
  font-size: 0.78rem;
  font-weight: 750;
}
.text-link { min-height: 44px; padding-block: 0; }
.back-button { min-height: 44px; margin: -12px 0 12px -8px; padding: 0 8px; }
.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-900);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 47, 48, 0.18);
  transition: background 150ms ease, transform 150ms ease;
}
.primary-button:hover { background: var(--brand-700); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: 0.7; }
button:focus-visible { outline: 3px solid rgba(13, 117, 109, 0.28); outline-offset: 2px; }
.auth-status { min-height: 24px; margin: 18px 0 0; color: var(--muted); font-size: 0.8rem; text-align: center; }
.auth-status.error { padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); }
.auth-status.success { padding: 10px 12px; border-radius: 10px; background: var(--success-soft); color: var(--success); }
.alert { margin: 0 0 20px; padding: 12px; border-radius: 10px; font-size: 0.82rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.support-copy { max-width: 460px; margin: 22px auto 0; color: var(--muted); font-size: 0.76rem; text-align: center; }

@media (max-height: 860px) and (min-width: 961px) {
  .brand-panel { padding: 38px 56px; }
  .brand-copy { margin: 34px 0 24px; }
  .brand-copy h1 { font-size: clamp(2.7rem, 4.4vw, 3.75rem); }
  .brand-description { margin-top: 18px; line-height: 1.5; }
  .trust-list li { padding: 11px 0; }
  .brand-footnote { margin-top: 18px; }
  .auth-panel { padding: 36px; }
  .auth-card { padding: 36px; }
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .auth-panel { min-height: 100dvh; padding: 32px; }
  .mobile-brand { display: flex; width: min(100%, 460px); margin: 0 auto 20px; }
}

@media (max-width: 720px) {
  body { background: var(--surface); }
  .auth-panel { align-content: start; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
  .mobile-brand { margin-bottom: clamp(44px, 10vh, 88px); }
  .auth-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .support-copy { margin-top: 36px; }
}

@media (max-width: 360px) {
  .auth-panel { padding-inline: 16px; }
  .auth-heading h2 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
