/* Sign-in pages (sign in, forgot password). See docs/design/DESIGN.md, "Sign-in pages".
   Brand tokens and self-hosted fonts come from brand/brand.css; nothing else is loaded. */

/* Animatable mask radii for the dot reveal (browsers without @property simply show
   the dots, because var() falls back to the end state). */
@property --reveal { syntax: "<percentage>"; inherits: false; initial-value: 150%; }
@property --ring { syntax: "<percentage>"; inherits: false; initial-value: 150%; }

.auth-body { background: var(--et-paper); color: var(--text-body); }

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

/* ---------------------------------------------------------- navy panel --- */
.auth-panel {
  position: relative;
  overflow: hidden;
  background: #12365C;
  color: #FFFFFF;
}

.auth-dots,
.auth-ring,
.auth-veil { position: absolute; inset: 0; pointer-events: none; }

/* Dot grid: two offset layers, revealed outward from the centre once. */
.auth-dots {
  background-image:
    radial-gradient(circle, rgba(127, 166, 208, 0.34) 1.5px, transparent 2px),
    radial-gradient(circle, rgba(127, 166, 208, 0.16) 1px, transparent 1.5px);
  background-size: 20px 20px, 20px 20px;
  background-position: 0 0, 10px 10px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 var(--reveal, 150%),
                                      transparent calc(var(--reveal, 150%) + 12%));
          mask-image: radial-gradient(circle at 50% 50%, #000 var(--reveal, 150%),
                                      transparent calc(var(--reveal, 150%) + 12%));
  animation: auth-reveal 2.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* One ring of sea-green dots sweeping outward in the same pass, fading as it goes. It sits
   above the veil (but under the text) so the sweep is seen; once it has faded, only the
   veiled grey dots remain. */
.auth-ring {
  z-index: 1;
  background-image: radial-gradient(circle, rgba(72, 199, 176, 0.9) 1.5px, transparent 2px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--ring, 150%) - 8%),
                                      #000 var(--ring, 150%), transparent calc(var(--ring, 150%) + 8%));
          mask-image: radial-gradient(circle at 50% 50%, transparent calc(var(--ring, 150%) - 8%),
                                      #000 var(--ring, 150%), transparent calc(var(--ring, 150%) + 8%));
  opacity: 0;
  animation: auth-ring 2.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes auth-reveal { from { --reveal: 0%; } to { --reveal: 150%; } }
@keyframes auth-ring {
  0%   { --ring: 0%; opacity: 1; }
  55%  { opacity: 0.85; }
  100% { --ring: 150%; opacity: 0; }
}

/* Short shimmer right after the reveal: four sparse layers of brighter dots that sit
   exactly on the grid (a tile of 20px x an odd number puts its centre dot on a grid point)
   each brighten and fade once, staggered. Every automatic animation on this page ends
   within 5 seconds of loading (WCAG 2.2.2: no pause control needed); then the dots rest.
   Opacity only. Under the veil, so dots behind the text stay faint. */
.auth-shimmer,
.auth-shimmer::before,
.auth-shimmer::after,
.auth-shimmer > span {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  animation: auth-shimmer 1.8s ease-in-out 2.4s 1 both;
}
.auth-shimmer::before,
.auth-shimmer::after { content: ""; }
.auth-shimmer {
  background: radial-gradient(circle, rgba(170, 200, 232, 0.75) 1.6px, transparent 2.1px) 0 0 / 60px 60px;
}
.auth-shimmer::before {
  background: radial-gradient(circle, rgba(170, 200, 232, 0.75) 1.6px, transparent 2.1px) 40px 20px / 100px 100px;
  animation-delay: 2.7s;
}
.auth-shimmer::after {
  background: radial-gradient(circle, rgba(127, 214, 198, 0.6) 1.6px, transparent 2.1px) 60px 100px / 140px 140px;
  animation-delay: 3s;
}
.auth-shimmer > span {
  background: radial-gradient(circle, rgba(170, 200, 232, 0.75) 1.6px, transparent 2.1px) 20px 40px / 60px 60px;
  animation-delay: 2.55s;
  animation-duration: 2s;
}
@keyframes auth-shimmer {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

/* Cursor glow, only in response to the mouse (static/auth-panel.js): sea-green dots on
   the same grid, shown through a soft 120px circle that follows the pointer (--glow-x,
   --glow-y). Brightens quickly while the pointer moves and fades back over 1s once it
   rests or leaves. Under the veil, so it is never at full strength behind the text. */
.auth-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* brighter, slightly larger sea-green dots on the grid, over a faint sea-green wash */
  background:
    radial-gradient(circle, rgba(72, 199, 176, 0.95) 2px, transparent 2.6px) 0 0 / 20px 20px,
    rgba(72, 199, 176, 0.10);
  -webkit-mask-image: radial-gradient(circle 120px at var(--glow-x, -200px) var(--glow-y, -200px),
                                      #000 0, #000 35%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
          mask-image: radial-gradient(circle 120px at var(--glow-x, -200px) var(--glow-y, -200px),
                                      #000 0, #000 35%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
  opacity: 0;
  transition: opacity 1s ease-out;
}
.auth-glow.is-lit { opacity: 1; transition-duration: 0.2s; }

/* Navy veil: keeps the dots faint behind the text. */
.auth-veil {
  background: radial-gradient(ellipse 70% 60% at 40% 50%,
              rgba(18, 54, 92, 0.78) 0%, rgba(18, 54, 92, 0.45) 55%, rgba(18, 54, 92, 0) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .auth-dots, .auth-ring { animation: none; }
  .auth-dots { --reveal: 150%; }
  .auth-ring, .auth-shimmer, .auth-glow { display: none; }
}

/* Touch screens and the phone layout: the load animation only, then still. */
@media (hover: none), (max-width: 799px) {
  .auth-glow { display: none; }
}

.auth-panel-in {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  min-height: 100%;
  padding: 48px 56px;
}

.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-logo { display: block; height: 36px; width: auto; }
.auth-brand-divider { width: 1px; height: 36px; background: rgba(255, 255, 255, 0.4); }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.auth-brand-sub { font-size: 14px; color: #DCE8F4; }

.auth-pitch { max-width: 520px; }
.auth-pitch-eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7FD6C6;
}
.auth-pitch-headline {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}
.auth-pitch-text { margin: 0 0 28px; font-size: 18px; line-height: 1.5; color: #DCE8F4; }
.auth-pitch-rule { display: block; width: 48px; height: 3px; background: var(--et-teal); }
.auth-panel-foot { margin: 0; font-size: 14px; color: #B6CEE6; }

/* --------------------------------------------------------- card side --- */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 48px 32px;
  background: #F4F7FB;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  background: #FFFFFF;
  border: 1px solid #E2E6EB;
  border-radius: 8px;
  box-shadow:
    0 1px 2px rgba(11, 34, 57, 0.06),
    0 12px 32px rgba(11, 34, 57, 0.10),
    0 0 72px 12px rgba(20, 176, 150, 0.20),
    0 0 140px 40px rgba(33, 82, 138, 0.12);
}

.auth-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0B6657;
}
.auth-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #12365C;
}
.auth-intro { margin: 0 0 28px; color: #4A5C6A; }

.auth-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.45;
}
.auth-msg p { margin: 0; }
.auth-msg-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.auth-msg-error { background: #FBEAEA; color: #A12F2F; }
.auth-msg-locked { background: #FBF1E1; color: #7A4E0E; }
.auth-msg-info { background: #E8F0F8; color: #12365C; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-label { font-weight: 600; color: #1A1A1A; }
.auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -10px 0;       /* a 44px target without pushing the field down */
  color: #21528A;
  font-weight: 600;
  font-size: 15px;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  color: #1A1A1A;
  background: #FFFFFF;
  border: 1px solid #AEB8C1;
  border-radius: 6px;
}
.auth-input::placeholder { color: #5F7180; opacity: 1; }
.auth-input:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: #0B6657; }

.auth-password { position: relative; }
.auth-password .auth-input { padding-right: 76px; }
/* Edge and old IE add their own eye icon to password fields; the Show button replaces it. */
.auth-password .auth-input::-ms-reveal,
.auth-password .auth-input::-ms-clear { display: none; }
.auth-show {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #21528A;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.auth-show[hidden] { display: none; }
.auth-show[aria-pressed="true"] { background: #EFF4FA; }
.auth-show:hover { text-decoration: underline; }

.auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
.auth-check input { width: 20px; height: 20px; margin: 0; accent-color: #0B6657; }

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #FFFFFF;
  background: #0B6657;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.auth-submit:hover { background: #095246; color: #FFFFFF; text-decoration: none; }

.auth-hint { margin: 0; font-size: 14px; color: #4A5C6A; }

/* Set your password / Set a new password: who the account is for, read-only. */
.auth-account {
  margin: 0 0 24px;
  padding: 12px 14px;
  background: #F4F7FB;
  border: 1px solid #E2E6EB;
  border-radius: 6px;
}
.auth-account div { display: flex; flex-wrap: wrap; gap: 0 8px; }
.auth-account div + div { margin-top: 4px; }
.auth-account dt { min-width: 88px; font-weight: 600; color: #4A5C6A; }
.auth-account dd { margin: 0; color: #1A1A1A; overflow-wrap: anywhere; }

.auth-back { display: flex; justify-content: center; margin-top: 20px; }
.auth-back .auth-link { margin: 0; }

.auth-note { margin: 0; max-width: 440px; text-align: center; font-size: 15px; color: #4A5C6A; }

/* ------------------------------------------------- phone: panels stack --- */
@media (max-width: 799px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-panel-in { padding: 20px 16px; gap: 0; }
  .auth-pitch, .auth-panel-foot { display: none; }
  .auth-logo { height: 28px; }
  .auth-brand-divider { height: 28px; }
  .auth-main { justify-content: flex-start; padding: 24px 16px 32px; }
  .auth-card { padding: 24px; }
  .auth-title { font-size: 24px; }
}
