:root {
  --navy-950: #08162f;
  --navy-900: #0d2244;
  --navy-800: #173765;
  --blue-600: #1769e0;
  --blue-500: #2f7df1;
  --blue-100: #e8f1ff;
  --cyan-400: #27c6d8;
  --ink: #16233a;
  --muted: #65738a;
  --line: #dce4ef;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --success: #12805c;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 24px 70px rgba(8, 22, 47, 0.14);
  --radius-lg: 24px;
  --radius-md: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }

a { color: inherit; }

.auth-body {
  background:
    radial-gradient(circle at 16% 15%, rgba(39, 198, 216, 0.12), transparent 32rem),
    var(--surface-soft);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
}

.auth-panel {
  width: min(100%, 580px);
  margin: auto;
  padding: 64px clamp(28px, 7vw, 84px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-900);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-600);
  color: #fff;
  font-size: .82rem;
  letter-spacing: .04em;
  box-shadow: 0 9px 22px rgba(23, 105, 224, .24);
}

.auth-heading { margin: 76px 0 34px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-600) !important;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.auth-heading h1,
.installer-heading h1,
.status-card h1 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.auth-heading p,
.installer-heading p,
.status-card p {
  margin: 14px 0 0;
  color: var(--muted);
}

.stack-form { display: grid; gap: 20px; }

.field { display: grid; gap: 8px; }

.field > span:first-child,
.field-label {
  color: var(--navy-900);
  font-size: .9rem;
  font-weight: 700;
}

.field small { color: var(--muted); font-size: .78rem; }

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field textarea { min-height: 94px; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(47, 125, 241, .13);
}

.password-field { position: relative; display: block; }
.password-field input { padding-right: 92px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  border: 0;
  padding: 8px 10px;
  transform: translateY(-50%);
  background: transparent;
  color: var(--blue-600);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(47,125,241,.28); outline-offset: 2px; }
.button-primary { background: var(--blue-600); color: #fff; box-shadow: 0 10px 24px rgba(23,105,224,.22); }
.button-primary:hover { background: #0f5bc9; }
.button-secondary { border-color: var(--line); background: #fff; color: var(--navy-900); }
.button-block { width: 100%; margin-top: 6px; }

.auth-footnote { margin: 22px 0 0; color: var(--muted); font-size: .86rem; text-align: center; }

.auth-aside {
  min-height: calc(100vh - 32px);
  margin: 16px 16px 16px 0;
  padding: clamp(38px, 7vw, 82px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(39,198,216,.17), transparent 46%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950));
  color: #fff;
  box-shadow: var(--shadow);
}

.aside-number { display: block; margin-bottom: 32px; color: var(--cyan-400); font-weight: 800; letter-spacing: .12em; }
.aside-card h2 { max-width: 600px; margin: 0; font-size: clamp(2.15rem, 4.8vw, 4.6rem); line-height: 1.02; letter-spacing: -.055em; }
.aside-card p { max-width: 520px; margin: 28px 0 0; color: #bacbe3; font-size: 1.04rem; }

.security-note { display: flex; gap: 12px; align-items: center; color: #dce8f8; font-size: .9rem; }
.security-icon { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: var(--cyan-400); }

.alert { border-radius: 12px; padding: 13px 15px; margin-bottom: 20px; font-size: .9rem; }
.alert-info { background: var(--blue-100); color: #174a91; }
.alert-error { background: #fff0ee; color: var(--danger); }
.alert-success { background: #eaf8f3; color: var(--success); }
.alert-warning { background: #fff8e6; color: var(--warning); }

.status-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.status-card { width: min(100%, 520px); padding: 42px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); text-align: center; }
.status-card .button { margin-top: 24px; }
.status-code { display: inline-block; margin-bottom: 18px; color: var(--blue-600); font-weight: 900; letter-spacing: .12em; }

.installer-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(39, 198, 216, .11), transparent 28rem),
    linear-gradient(180deg, #f7faff 0%, #eef3f9 100%);
}

.installer-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 72px;
}

.installer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.installer-badge {
  border: 1px solid #cdd9e8;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}

.stepper {
  display: flex;
  gap: 5px;
  margin: 0 0 24px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px 2px 10px;
}

.stepper-item {
  display: flex;
  flex: 1 0 auto;
  min-width: 92px;
  align-items: center;
  gap: 7px;
  color: #8793a5;
  font-size: .75rem;
  font-weight: 700;
}

.stepper-dot {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid #d6dfeb;
  border-radius: 50%;
  background: rgba(255,255,255,.8);
  font-size: .72rem;
}

.stepper-item.is-current { color: var(--blue-600); }
.stepper-item.is-current .stepper-dot { border-color: var(--blue-600); background: var(--blue-600); color: #fff; box-shadow: 0 5px 14px rgba(23,105,224,.2); }
.stepper-item.is-complete { color: var(--success); }
.stepper-item.is-complete .stepper-dot { border-color: #b9e2d4; background: #e9f8f2; }

.installer-card {
  width: min(100%, 790px);
  margin: 0 auto;
  border: 1px solid rgba(210, 221, 235, .9);
  border-radius: 24px;
  padding: clamp(26px, 5vw, 54px);
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 64px rgba(16, 37, 70, .1);
}

.installer-card.wide { width: min(100%, 960px); }
.installer-welcome { overflow: hidden; background: linear-gradient(145deg, #fff 65%, #eef6ff); }
.installer-heading { max-width: 720px; margin-bottom: 34px; }
.installer-heading.compact h1 { font-size: clamp(1.85rem, 4vw, 2.65rem); }
.installer-heading.compact { margin-bottom: 30px; }

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0;
}

.welcome-grid div {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255,255,255,.8);
}
.welcome-grid strong { color: var(--blue-600); font-size: .8rem; letter-spacing: .08em; }
.welcome-grid span { color: var(--navy-900); font-size: .9rem; font-weight: 700; }

.check-list { display: grid; margin: 0 0 28px; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.check-row { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row > span { display: grid; color: var(--navy-900); font-weight: 650; }
.check-row small { color: var(--muted); font-size: .74rem; font-weight: 500; }
.check-row strong { flex: 0 0 auto; font-size: .8rem; }
.check-pass { color: var(--success); }
.check-fail { color: var(--danger); }

.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 28px; }
.form-actions.split { justify-content: space-between; gap: 12px; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: none; }

.section-label { display: flex; align-items: center; gap: 14px; margin: 4px 0 -2px; color: var(--blue-600); font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.section-label::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.choice-row {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
}
.choice-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue-600); }
.choice-row span { display: grid; gap: 3px; }
.choice-row strong { color: var(--navy-900); }
.choice-row small { color: var(--muted); }

.policy-note,
.install-process {
  border-radius: 14px;
  padding: 17px;
  background: var(--surface-soft);
  color: var(--muted);
}
.policy-note { display: grid; gap: 4px; }
.policy-note strong { color: var(--navy-900); }
.policy-note span { font-size: .86rem; }

.summary-list { display: grid; margin: 0 0 26px; border-top: 1px solid var(--line); }
.summary-list div { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; color: var(--navy-900); font-weight: 750; text-align: right; }

.install-process { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; }
.install-process span::before { content: "✓"; margin-right: 8px; color: var(--success); font-weight: 900; }

.finish-card { text-align: center; }
.finish-card .installer-heading { margin-left: auto; margin-right: auto; }
.success-emblem { display: grid; width: 66px; height: 66px; place-items: center; margin: 0 auto 24px; border-radius: 20px; background: #e6f8f1; color: var(--success); font-size: 2rem; font-weight: 900; }

@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { padding: 34px 24px 52px; }
  .auth-heading { margin: 52px 0 30px; }
  .auth-aside { display: none; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper-item span:last-child { display: none; }
  .stepper-item { min-width: 30px; }
}

@media (max-width: 620px) {
  .installer-shell { width: min(100% - 22px, 1180px); padding-top: 16px; }
  .installer-card { padding: 25px 19px; border-radius: 19px; }
  .form-grid.two,
  .form-grid.three,
  .welcome-grid,
  .install-process { grid-template-columns: 1fr; }
  .form-actions.split { flex-direction: column-reverse; }
  .form-actions.split .button { width: 100%; }
  .summary-list div { grid-template-columns: 1fr; gap: 2px; }
  .summary-list dd { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
