/* =========================================================================
   ResnSec360 — Authentication experience
   Scoped to the sign-in / signed-out screens via .auth-body.
   Palette is derived from the ResnSec360 mark (navy / cyan / red) and the
   Dell-inspired product blue used across the Control Center.
   ========================================================================= */

.auth-body {
  --auth-navy-900: #05101F;
  --auth-navy-800: #081A2E;
  --auth-navy-700: #0C2340;
  --auth-navy-600: #14294A;
  --auth-cyan:     #2BB3D1;
  --auth-cyan-lit: #5FD6EE;
  --auth-red:      #E01F26;
  --auth-blue:     #0076CE;
  --auth-blue-dk:  #004B8D;

  --auth-ink:      #10192B;
  --auth-ink-soft: #5A6779;
  --auth-line:     #DFE5EC;
  --auth-surface:  #FFFFFF;
  --auth-canvas:   #F4F7FB;

  margin: 0;
  min-height: 100vh;
  background: var(--auth-canvas);
  color: var(--auth-ink);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 100vh;
}

.auth-shell,
.auth-shell *,
.auth-shell *::before,
.auth-shell *::after {
  box-sizing: border-box;
}

/* =========================================================================
   1. Brand panel
   ========================================================================= */

.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 44px 56px 40px;
  color: #EAF2FA;
  background:
    radial-gradient(820px 560px at 12% 8%,  rgba(43, 179, 209, 0.30), transparent 62%),
    radial-gradient(700px 500px at 94% 96%, rgba(224, 31, 38, 0.145), transparent 58%),
    radial-gradient(980px 700px at 62% 46%, rgba(0, 118, 206, 0.26),  transparent 66%),
    linear-gradient(158deg, var(--auth-navy-700) 0%, var(--auth-navy-800) 52%, var(--auth-navy-900) 100%);
}

/* Blueprint grid + slow drift */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(closest-side at 42% 44%, #000 25%, transparent 88%);
          mask-image: radial-gradient(closest-side at 42% 44%, #000 25%, transparent 88%);
  animation: auth-grid-drift 28s linear infinite;
}

/* Diagonal light sheen */
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.05) 50%, transparent 62%);
  pointer-events: none;
}

@keyframes auth-grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(46px, 46px, 0); }
}

/* --- Brand lockup ------------------------------------------------------- */

.auth-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-lockup__mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.auth-lockup__word {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  color: #FFFFFF;
}

.auth-lockup__word span {
  color: var(--auth-cyan-lit);
}

.auth-lockup__rule {
  height: 2px;
  width: 100%;
  margin: 7px 0 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--auth-cyan) 0%, var(--auth-cyan) 34%, var(--auth-red) 34%, var(--auth-red) 100%);
  opacity: 0.85;
}

.auth-lockup__tag {
  font-size: 0.665rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: rgba(234, 242, 250, 0.62);
}

/* --- Hero: the 360° resilience ring ------------------------------------- */

.auth-hero {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
}

/* The 40vh term keeps the ring from overflowing the clipped brand panel on
   shorter laptop screens, where the lockup/pillars/chips already claim ~420px. */
.auth-ring {
  position: relative;
  width: min(360px, 74%, 40vh);
  aspect-ratio: 1;
}

.auth-ring__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.auth-ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1.25;
}

.auth-ring__tick {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.auth-ring__seg {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(43, 179, 209, 0.45));
  animation: auth-seg-draw 1.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-ring__seg:nth-of-type(1) { animation-delay: 0.15s; }
.auth-ring__seg:nth-of-type(2) { animation-delay: 0.30s; }
.auth-ring__seg:nth-of-type(3) { animation-delay: 0.45s; }
.auth-ring__seg:nth-of-type(4) { animation-delay: 0.60s; }
.auth-ring__seg:nth-of-type(5) { animation-delay: 0.75s; }

@keyframes auth-seg-draw {
  from { stroke-dasharray: 0 100; opacity: 0; }
  to   { stroke-dasharray: 17.2 82.8; opacity: 1; }
}

/* Radar sweep */
.auth-ring__sweep {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  background: conic-gradient(
    from 0turn,
    rgba(43, 179, 209, 0) 0deg,
    rgba(43, 179, 209, 0.02) 210deg,
    rgba(43, 179, 209, 0.20) 330deg,
    rgba(95, 214, 238, 0.42) 357deg,
    rgba(43, 179, 209, 0) 360deg
  );
  -webkit-mask-image: radial-gradient(circle, transparent 0 26%, #000 34% 100%);
          mask-image: radial-gradient(circle, transparent 0 26%, #000 34% 100%);
  animation: auth-sweep 7.5s linear infinite;
}

@keyframes auth-sweep {
  to { transform: rotate(1turn); }
}

/* Breathing halo behind the core */
.auth-ring__pulse {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 179, 209, 0.30) 0%, transparent 70%);
  animation: auth-pulse 3.6s ease-in-out infinite;
}

@keyframes auth-pulse {
  0%, 100% { transform: scale(0.9);  opacity: 0.55; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* Core shield */
.auth-ring__core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 6px;
  grid-auto-flow: row;
  align-content: center;
  text-align: center;
}

.auth-ring__shield {
  width: 30%;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
}

.auth-ring__score {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(234, 242, 250, 0.55);
}

/* Orbiting node markers */
.auth-ring__node {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(43, 179, 209, 0.28), 0 0 12px rgba(95, 214, 238, 0.9);
  animation: auth-node-blip 3.2s ease-in-out infinite;
}

@keyframes auth-node-blip {
  0%, 100% { transform: scale(1);   opacity: 0.75; }
  50%      { transform: scale(1.4); opacity: 1; }
}

/* --- Capability list ---------------------------------------------------- */

.auth-pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.auth-pillar {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
  align-items: start;
}

.auth-pillar__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--auth-cyan-lit);
}

.auth-pillar__icon svg {
  width: 17px;
  height: 17px;
}

.auth-pillar__title {
  display: block;
  font-size: 0.855rem;
  font-weight: 650;
  color: #FFFFFF;
  line-height: 1.35;
}

.auth-pillar__text {
  display: block;
  font-size: 0.775rem;
  line-height: 1.45;
  color: rgba(234, 242, 250, 0.58);
}

/* --- Assurance strip ---------------------------------------------------- */

.auth-assurance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: rgba(234, 242, 250, 0.78);
}

.auth-chip svg {
  width: 12px;
  height: 12px;
  color: var(--auth-cyan-lit);
}

.auth-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35D07F;
  box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.20);
  animation: auth-live 2.4s ease-in-out infinite;
}

@keyframes auth-live {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* =========================================================================
   2. Form panel
   ========================================================================= */

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  background: var(--auth-surface);
}

/* Faint corner wash so the white side isn't dead flat */
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 340px at 100% 0%,   rgba(0, 118, 206, 0.055), transparent 70%),
    radial-gradient(480px 320px at 0% 100%,   rgba(224, 31, 38, 0.035),  transparent 70%);
}

.auth-form-wrap {
  position: relative;
  width: 100%;
  max-width: 408px;
  margin: 0 auto;
}

/* Block-level so the CONTROL CENTER eyebrow starts on its own line. */
.auth-panel__logo-link {
  display: block;
  margin-bottom: 28px;
}

.auth-panel__logo {
  display: block;
  height: 52px;
  width: auto;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--auth-blue-dk);
  margin-bottom: 10px;
}

.auth-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--auth-cyan), var(--auth-red));
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.66rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  color: var(--auth-ink);
}

.auth-subtitle {
  margin: 0 0 26px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--auth-ink-soft);
}

/* --- Alerts ------------------------------------------------------------- */

.auth-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  border: 1px solid transparent;
  animation: auth-alert-in 0.28s ease-out both;
}

.auth-alert svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.auth-alert--danger {
  background: #FDECEE;
  border-color: #F5C2C7;
  color: #8E1119;
}

.auth-alert--warning {
  background: #FFF4E5;
  border-color: #FFD8A8;
  color: #8A4B00;
}

@keyframes auth-alert-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}

/* --- Fields ------------------------------------------------------------- */

.auth-field {
  position: relative;
  margin-bottom: 15px;
}

.auth-field__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #9AA6B6;
  pointer-events: none;
  transition: color 0.18s ease;
  z-index: 2;
}

.auth-body .auth-field .form-control,
.auth-body .auth-field input[type="text"],
.auth-body .auth-field input[type="password"] {
  width: 100%;
  height: 56px;
  padding: 22px 44px 8px 42px;
  font-size: 0.9rem;
  color: var(--auth-ink);
  background: #FBFCFE;
  border: 1.5px solid var(--auth-line);
  border-radius: 11px;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.auth-body .auth-field .form-control:hover {
  border-color: #C4D0DE;
}

.auth-body .auth-field .form-control:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(0, 118, 206, 0.13);
}

.auth-field .form-control:focus ~ .auth-field__icon {
  color: var(--auth-blue);
}

/* Floating label — relies on the widget rendering placeholder=" " */
.auth-field__label {
  position: absolute;
  top: 50%;
  left: 43px;
  transform: translateY(-50%);
  font-size: 0.885rem;
  color: #8B97A8;
  pointer-events: none;
  transition: transform 0.16s ease, font-size 0.16s ease, color 0.16s ease;
  transform-origin: left center;
  z-index: 2;
}

.auth-field .form-control:focus ~ .auth-field__label,
.auth-field .form-control:not(:placeholder-shown) ~ .auth-field__label {
  /* Keep the -50% centering offset, then lift into the input's top padding. */
  transform: translateY(calc(-50% - 13px)) scale(0.8);
  color: var(--auth-blue-dk);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Kept in its own rule: an unsupported vendor pseudo-class would otherwise
   invalidate the whole selector list above. */
.auth-field .form-control:-webkit-autofill ~ .auth-field__label {
  /* Keep the -50% centering offset, then lift into the input's top padding. */
  transform: translateY(calc(-50% - 13px)) scale(0.8);
  color: var(--auth-blue-dk);
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Chrome paints autofilled inputs yellow; repaint them with our surface. */
.auth-body .auth-field .form-control:-webkit-autofill,
.auth-body .auth-field .form-control:-webkit-autofill:hover,
.auth-body .auth-field .form-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-ink);
  -webkit-box-shadow: inset 0 0 0 1000px #FBFCFE;
  caret-color: var(--auth-ink);
}

/* Fallback: if the widget has no placeholder, keep the label raised so it
   never overlaps typed text. */
.auth-field--static .auth-field__label {
  /* Keep the -50% centering offset, then lift into the input's top padding. */
  transform: translateY(calc(-50% - 13px)) scale(0.8);
  color: var(--auth-blue-dk);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.auth-field__toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8B97A8;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
  z-index: 3;
}

.auth-field__toggle:hover {
  color: var(--auth-blue);
  background: rgba(0, 118, 206, 0.08);
}

.auth-field__toggle svg {
  width: 17px;
  height: 17px;
}

.auth-field__toggle .auth-icon-hide { display: none; }
.auth-field__toggle[aria-pressed="true"] .auth-icon-hide { display: block; }
.auth-field__toggle[aria-pressed="true"] .auth-icon-show { display: none; }

/* Django field errors */
.auth-body .auth-field .errorlist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 0.765rem;
  color: #C62828;
}

.auth-field--invalid .form-control {
  border-color: #E5808A;
  background: #FEF7F8;
}

/* Caps-lock notice */
.auth-hint {
  display: none;
  align-items: center;
  gap: 7px;
  margin: -6px 0 14px;
  font-size: 0.755rem;
  color: #8A4B00;
}

.auth-hint.is-visible { display: flex; }

.auth-hint svg {
  width: 13px;
  height: 13px;
}

/* --- Submit ------------------------------------------------------------- */

.auth-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  font-size: 0.925rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  cursor: pointer;
  background: linear-gradient(112deg, var(--auth-navy-700) 0%, var(--auth-blue-dk) 48%, var(--auth-blue) 100%);
  box-shadow: 0 8px 20px -8px rgba(0, 75, 141, 0.65);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transition: transform 0.65s ease;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -8px rgba(0, 75, 141, 0.75);
}

.auth-submit:hover::after { transform: translateX(120%) skewX(-18deg); }

.auth-submit:active { transform: translateY(0); }

.auth-submit:focus-visible {
  outline: 3px solid rgba(0, 118, 206, 0.45);
  outline-offset: 2px;
}

.auth-submit svg {
  width: 17px;
  height: 17px;
  transition: transform 0.18s ease;
}

.auth-submit:hover svg { transform: translateX(3px); }

.auth-submit .auth-submit__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

.auth-submit.is-busy {
  pointer-events: none;
  filter: saturate(0.85);
}

.auth-submit.is-busy .auth-submit__spinner { display: block; }
.auth-submit.is-busy svg,
.auth-submit.is-busy .auth-submit__label { display: none; }

@keyframes auth-spin {
  to { transform: rotate(1turn); }
}

/* --- Panel footer ------------------------------------------------------- */

.auth-notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--auth-line);
  font-size: 0.755rem;
  line-height: 1.55;
  color: #7A8798;
}

.auth-notice svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--auth-blue);
}

.auth-colophon {
  margin-top: 14px;
  font-size: 0.71rem;
  color: #9AA6B6;
}

/* =========================================================================
   3. Responsive
   ========================================================================= */

@media (max-width: 1199.98px) {
  .auth-brand { padding: 36px 40px 32px; }
  .auth-ring  { width: min(300px, 72%); }
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
    /* Brand band hugs its content; the form claims the rest of the screen. */
    grid-template-rows: auto 1fr;
    min-height: 100vh;
  }

  .auth-brand {
    gap: 18px;
    padding: 26px 24px 24px;
  }

  .auth-hero,
  .auth-pillars {
    display: none;
  }

  .auth-assurance {
    padding-top: 16px;
  }

  .auth-panel {
    padding: 34px 24px 44px;
    justify-content: flex-start;
  }

  .auth-panel__logo { height: 40px; margin-bottom: 24px; }
}

@media (max-width: 575.98px) {
  .auth-title    { font-size: 1.42rem; }
  .auth-chip     { font-size: 0.66rem; padding: 4px 9px; }
  .auth-panel    { padding: 28px 18px 36px; }
}

/* Short viewports: don't let the hero squeeze the copy */
@media (min-width: 992px) and (max-height: 720px) {
  .auth-ring    { width: min(230px, 52%, 34vh); }
  .auth-pillars { gap: 10px; }
}

/* =========================================================================
   4. Motion & contrast preferences
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  .auth-body *,
  .auth-body *::before,
  .auth-body *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .auth-ring__seg { stroke-dasharray: 17.2 82.8; opacity: 1; }
  .auth-ring__sweep { display: none; }
}

@media (forced-colors: active) {
  .auth-body .auth-field .form-control { border: 1px solid CanvasText; }
  .auth-submit { border: 1px solid ButtonText; }
}
