:root {
  --navy-900: #04192d;
  --navy-850: #061727;
  --navy-700: #0e2c4b;
  --input-bg: #102a42;
  --input-border: #27415a;
  --input-border-focus: #4c8fbf;
  --text: #ffffff;
  --text-muted: #b6c3d1;
  --text-dim: #8798aa;
  --green: #4cbf50;
  --green-button: #238045;
  --green-button-hover: #2a9452;
  --gold: #e7b03c;
  --link: #94c9e0;
  --danger-bg: rgba(220, 70, 70, .14);
  --danger-border: rgba(240, 110, 110, .5);
  --danger-text: #ffb4b4;
  --radius: 8px;
  font-family: Inter, Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--navy-900);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--gold { color: var(--gold); }

.login {
  display: grid;
  grid-template-columns: minmax(0, 60fr) minmax(420px, 40fr);
  min-height: 100vh;
}

/* ── Brand panel ──────────────────────────────────────────── */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(115deg, var(--navy-850) 0%, #0a2340 45%, var(--navy-700) 100%);
}
.brand__bg {
  position: absolute;
  inset: 0 0 auto auto;
  width: min(46%, 600px);
  height: min(88%, 680px);
  background: url("assets/cathedral.webp") right top / cover no-repeat;
  opacity: .9;
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%), linear-gradient(180deg, #000 70%, transparent 100%);
  mask-composite: intersect;
}
.brand__wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4%;
  width: 100%;
  height: 28%;
  pointer-events: none;
}
.brand__inner {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px 7% 28px 4.5%;
}

.env-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(10, 32, 56, .75);
  font-size: 13px;
  font-weight: 500;
}
.env-pill .icon { width: 16px; height: 16px; }
.env-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.logo { display: flex; align-items: center; }
.logo img { display: block; height: auto; }
.logo__divider { align-self: stretch; width: 1px; background: rgba(255, 255, 255, .45); }
.logo__word { text-transform: uppercase; color: #dfe6ee; }

.logo--large { margin: auto 0 3.5vh; padding-top: 4vh; gap: 22px; }
.logo--large img { width: 150px; }
.logo--large .logo__divider { margin: 16px 0 6px; }
.logo--large .logo__word { font-size: 31px; font-weight: 400; letter-spacing: .14em; line-height: 1.12; color: #c9d4df; }

.brand__title { margin: 0; font-size: clamp(26px, 2.9vw, 44px); font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.brand__title span { color: var(--gold); }
.brand__lead { margin: 12px 0 0; font-size: 17px; color: var(--text-muted); }

.features { list-style: none; margin: 4.2vh 0 auto; padding: 0 0 8vh; display: grid; gap: 20px; }
.features li { display: flex; gap: 22px; align-items: flex-start; }
.features .icon { width: 22px; height: 22px; margin-top: 2px; }
.features strong { display: block; font-size: 16px; font-weight: 600; }
.features span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--text-muted); }

.brand__copy { margin: 0; padding-top: 24px; font-size: 12.5px; color: var(--text-dim); }

/* ── Sign-in panel ────────────────────────────────────────── */

.panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--navy-900);
}
.panel__inner { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }

.settings {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.settings .icon { width: 22px; height: 22px; }
.settings:hover, .settings[aria-expanded="true"] { background: rgba(255, 255, 255, .06); }
.env-details {
  position: absolute;
  top: 80px;
  right: 24px;
  z-index: 2;
  min-width: 260px;
  padding: 14px 16px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: #0b2238;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
  font-size: 13px;
}
.env-details dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.env-details dt { color: var(--text-dim); }
.env-details dd { margin: 0; color: var(--text); }

.logo--small { gap: 12px; }
.logo--small img { width: 96px; }
.logo--small .logo__divider { margin: 14px 0 4px; background: rgba(255, 255, 255, .7); }
.logo--small .logo__word { font-size: 22px; font-weight: 600; letter-spacing: .02em; color: #fff; }

.panel__subtitle { margin: 14px 0 0; font-size: 19px; color: var(--text-muted); }

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 30px;
  padding: 10px 30px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: #0f263b;
  font-size: 15px;
  color: var(--text-muted);
}
.stage-pill strong { color: #fff; font-weight: 600; }
.stage-pill .icon { margin-right: 6px; color: #fff; }

.form { width: 100%; }

.alert {
  margin-bottom: 18px;
  padding: 10px 14px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-size: 14px;
}

.field { display: block; margin-bottom: 22px; }
.field__label { display: block; margin-bottom: 10px; font-size: 15px; font-weight: 500; }
.field__control {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text-muted);
  transition: border-color .15s, box-shadow .15s;
}
.field__control:focus-within { border-color: var(--input-border-focus); box-shadow: 0 0 0 3px rgba(76, 143, 191, .25); }
.field__control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.field__control input::placeholder { color: #7f91a4; }
.field__control input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 40px var(--input-bg) inset;
  caret-color: var(--text);
}

.reveal { display: grid; place-items: center; padding: 6px; border: 0; background: none; color: #dfe6ee; cursor: pointer; border-radius: 6px; }
.reveal:focus-visible { outline: 2px solid var(--input-border-focus); }
.reveal .icon { width: 20px; height: 20px; }

.form__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 26px; font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: #49a579; cursor: pointer; }

.link { border: 0; padding: 0; background: none; color: var(--link); cursor: pointer; font-size: 15px; }
.link:hover { text-decoration: underline; }

.forgot-help { margin: -14px 0 22px; font-size: 13.5px; color: var(--text-muted); }

.submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: var(--green-button);
  box-shadow: 0 6px 18px rgba(35, 128, 69, .3);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.submit:hover { background: var(--green-button-hover); }
.submit:focus-visible { outline: 3px solid rgba(148, 201, 224, .7); outline-offset: 2px; }
.submit[disabled] { opacity: .7; cursor: progress; }
.submit .icon { width: 22px; height: 22px; }

.panel__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 15px;
  color: var(--text-muted);
}
.panel__footer span:first-child { display: inline-flex; align-items: center; gap: 12px; }
.panel__footer .icon { width: 20px; height: 20px; }
.panel__footer-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .3); }

@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .brand { display: none; }
  .panel { min-height: 100vh; padding: 72px 20px 32px; }
}
