:root {
  --v4-ink: #172033;
  --v4-muted: #64748b;
  --v4-line: #dbe3ee;
  --v4-primary: #175cd3;
  --v4-primary-dark: #123f91;
  --v4-accent: #0f766e;
}

html,
body {
  min-height: 100%;
}

body.v4-auth-page {
  margin: 0;
  color: var(--v4-ink);
  font-family: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(23, 92, 211, .16), transparent 28rem),
    radial-gradient(circle at 92% 88%, rgba(15, 118, 110, .15), transparent 26rem),
    #eef3f8;
}

.v4-auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.v4-auth-shell {
  width: min(100%, 68rem);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(24rem, .92fr);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 2rem 5rem rgba(15, 23, 42, .16);
}

.v4-auth-brand {
  position: relative;
  isolation: isolate;
  min-height: 39rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: #f8fafc;
  background: linear-gradient(145deg, #0b1732 0%, #123f66 56%, #0f766e 115%);
}

.v4-auth-brand::before,
.v4-auth-brand::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}

.v4-auth-brand::before {
  width: 20rem;
  height: 20rem;
  top: -8rem;
  left: -7rem;
}

.v4-auth-brand::after {
  width: 17rem;
  height: 17rem;
  right: -7rem;
  bottom: -7rem;
}

.v4-auth-logo {
  width: 5rem;
  height: 5rem;
  display: block;
  margin-bottom: 1.5rem;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 1.25rem;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, .2);
}

.v4-auth-version {
  display: inline-flex;
  width: max-content;
  padding: .35rem .7rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(255, 255, 255, .08);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.v4-auth-brand h1 {
  max-width: 30rem;
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
}

.v4-auth-brand-copy,
.v4-auth-brand-foot {
  color: rgba(248, 250, 252, .76);
}

.v4-auth-brand-copy {
  max-width: 31rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.v4-auth-features {
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.v4-auth-features li {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  color: rgba(248, 250, 252, .9);
}

.v4-auth-feature-icon {
  flex: 0 0 1.4rem;
  height: 1.4rem;
  display: inline-grid;
  place-items: center;
  margin-top: .05rem;
  border-radius: 50%;
  color: #082f49;
  background: #7dd3fc;
  font-size: .75rem;
  font-weight: 900;
}

.v4-auth-brand-foot {
  margin: 2rem 0 0;
  font-size: .85rem;
}

.v4-auth-panel {
  align-self: center;
  padding: 3rem;
}

.v4-auth-eyebrow {
  margin-bottom: .55rem;
  color: var(--v4-primary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.v4-auth-panel h2 {
  margin-bottom: .6rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -.025em;
}

.v4-auth-subtitle {
  margin-bottom: 1.75rem;
  color: var(--v4-muted);
  line-height: 1.6;
}

.v4-auth-panel .alert {
  padding: .8rem 1rem;
  border-radius: .85rem;
}

.v4-auth-panel .form-label {
  margin-bottom: .45rem;
  color: #334155;
  font-weight: 600;
}

.v4-auth-panel .form-control,
.v4-auth-panel .form-select {
  min-height: 3.1rem;
  border-color: var(--v4-line);
  border-radius: .85rem;
}

.v4-auth-panel .form-control:focus,
.v4-auth-panel .form-select:focus {
  border-color: #76a7ec;
  box-shadow: 0 0 0 .25rem rgba(23, 92, 211, .12);
}

.v4-auth-submit {
  min-height: 3.1rem;
  border: 0;
  border-radius: .85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--v4-primary), var(--v4-accent));
  box-shadow: 0 .8rem 1.8rem rgba(23, 92, 211, .2);
  font-weight: 700;
}

.v4-auth-submit:hover,
.v4-auth-submit:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--v4-primary-dark), #0b615b);
}

.v4-auth-secondary {
  min-height: 3.1rem;
  border-color: #cbd5e1;
  border-radius: .85rem;
  color: #334155;
  font-weight: 700;
}

.v4-auth-help {
  margin: 1.25rem 0 0;
  color: var(--v4-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.v4-auth-context {
  padding: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid #d7e4f2;
  border-radius: 1rem;
  background: #f5f9ff;
  color: #334155;
}

.v4-auth-countdown {
  display: inline-flex;
  min-width: 3rem;
  justify-content: center;
  padding: .1rem .55rem;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-weight: 700;
}

.v4-password-toggle {
  min-width: 3.5rem;
  border-color: var(--v4-line);
  color: var(--v4-muted);
  background: var(--v4-panel);
}

.v4-password-toggle:hover,
.v4-password-toggle:focus {
  color: var(--v4-primary);
  background: #f3f7fd;
}

.v4-password-toggle svg {
  display: block;
  margin: auto;
}

.v4-auth-back {
  color: #475569;
  font-weight: 600;
  text-decoration: none;
}

.v4-auth-back:hover {
  color: var(--v4-primary);
}

@media (max-width: 991.98px) {
  .v4-auth-shell { grid-template-columns: 1fr; width: min(100%, 42rem); }
  .v4-auth-brand { min-height: auto; padding: 2.25rem; }
  .v4-auth-brand h1 { font-size: 2.1rem; }
  .v4-auth-brand-foot { display: none; }
}

@media (max-width: 575.98px) {
  .v4-auth-wrap { display: block; padding: 0; background: #fff; }
  .v4-auth-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .v4-auth-brand { padding: 1.6rem; }
  .v4-auth-logo { width: 4rem; height: 4rem; margin-bottom: 1rem; }
  .v4-auth-features { display: none; }
  .v4-auth-brand-copy { margin-bottom: 0; font-size: .95rem; }
  .v4-auth-panel { padding: 2rem 1.4rem; }
}
