/* ============================================================
   Auth page — FTTH Live Status
   Theme: fiber-optic light signal, deep blue / cyan, generic telecom
   Token system:
   --auth-deep     : near-black blue base (stage bg)
   --auth-blue     : mid blue (gradient floor / panel accents)
   --auth-cyan     : signature glow color (strands, pulse, CTA)
   --auth-cyan-dim : muted cyan for borders/secondary accents
   --auth-ink      : form-side text
   --auth-muted    : secondary text
   --auth-line     : hairline borders on the light panel
   ============================================================ */

.auth-body {
  --auth-deep: #050b18;
  --auth-blue: #0a1f3d;
  --auth-cyan: #3fd0ff;
  --auth-cyan-dim: #1f8fb8;
  --auth-ink: #0e1c26;
  --auth-muted: #5c6b75;
  --auth-line: #d6e2e8;

  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  background: var(--auth-deep);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  min-height: 100vh;
}

/* ---------------- LEFT: fiber-optic stage ---------------- */

.auth-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 78%, rgba(63, 208, 255, 0.16) 0%, transparent 45%),
    linear-gradient(160deg, #050b18 0%, #07142a 55%, #0a1f3d 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
}

.fiber-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.strand {
  fill: none;
  stroke: url(#strandFade);
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.7;
}
.strand--a { stroke-width: 1.4; }
.strand--b { stroke-width: 1.8; opacity: 0.55; }
.strand--c { stroke-width: 1.2; opacity: 0.6; }

.fiber-strands {
  animation: fiber-drift 22s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes fiber-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10px, 8px) scale(1.015); }
}

.pulse-particle {
  fill: #eafcff;
  filter: drop-shadow(0 0 4px #3fd0ff) drop-shadow(0 0 9px #3fd0ff);
}
.pulse-particle--cyan { fill: #9fe9ff; }

@media (prefers-reduced-motion: reduce) {
  .fiber-strands { animation: none; }
  .pulse-particle { display: none; }
}

.auth-stage-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(5, 11, 24, 0.45) 0%,
      rgba(5, 11, 24, 0.30) 38%,
      rgba(5, 11, 24, 0.75) 78%,
      rgba(5, 11, 24, 0.94) 100%);
  pointer-events: none;
}

.auth-stage-content {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 5vw, 64px);
  padding-bottom: 28px;
  color: #eef6f9;
  max-width: 620px;
}

.auth-brandmark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand-text {
  font-family: "Barlow Condensed", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #eef6f9;
}
.auth-brand-text strong { color: var(--auth-cyan); font-weight: 700; }

/* Signature element: optical signal-pulse — concentric rings emanating from a
   node, referencing live light propagation through fiber. */
.pulse-node {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-node--sm { width: 30px; height: 30px; }

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--auth-cyan);
  box-shadow: 0 0 8px 1px rgba(63, 208, 255, 0.65);
  z-index: 2;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--auth-cyan);
  background: transparent;
  opacity: 0;
  animation: pulse-expand 2.6s ease-out infinite;
}
.pulse-ring--delay { animation-delay: 1.3s; }

@keyframes pulse-expand {
  0%   { transform: scale(0.25); opacity: 0.85; }
  70%  { opacity: 0.12; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-ring { animation: none; opacity: 0.3; }
}

/* ---------------- RIGHT: form panel ---------------- */

.auth-form-side {
  background: #f5f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
}

.auth-form-wrap {
  width: 100%;
  max-width: 380px;
}

.auth-form-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-form-brand .pulse-dot { background: var(--auth-cyan-dim); box-shadow: 0 0 8px 1px rgba(31, 143, 184, 0.5); }
.auth-form-brand .pulse-ring { border-color: var(--auth-cyan-dim); }

.auth-form-title {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--auth-ink);
  letter-spacing: 0.01em;
}
.auth-form-kicker {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-form-heading {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 28px;
  color: var(--auth-ink);
  margin: 0 0 6px;
}

.auth-form-helper {
  font-size: 13.5px;
  color: var(--auth-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

.auth-flash-stack { margin-bottom: 14px; }
.flash {
  font-size: 13px;
  margin: 0 0 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #fbeaea;
  border: 1px solid #e9c4c4;
}
.flash.error { color: #a22222; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--auth-ink);
  letter-spacing: 0.01em;
}

.field-control {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-control:focus-within {
  border-color: var(--auth-cyan-dim);
  box-shadow: 0 0 0 2px rgba(31, 143, 184, 0.22);
}

.field-icon {
  width: 18px;
  height: 18px;
  margin-left: 12px;
  color: var(--auth-muted);
  flex: none;
}

.field-control input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--auth-ink);
  min-width: 0;
}
.field-control input:focus { outline: none; }

.field-toggle {
  border: 0;
  background: transparent;
  padding: 8px 10px;
  margin-right: 2px;
  cursor: pointer;
  color: var(--auth-muted);
  display: flex;
  align-items: center;
}
.field-toggle svg { width: 18px; height: 18px; }
.field-toggle:hover { color: var(--auth-ink); }
.field-toggle[aria-pressed="true"] { color: var(--auth-cyan-dim); }

.auth-submit {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  height: 46px;
  background: linear-gradient(135deg, #1f8fb8 0%, #0a1f3d 130%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 0 rgba(63, 208, 255, 0);
}
.auth-submit:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 18px rgba(31, 143, 184, 0.35);
}
.auth-submit:active { transform: translateY(1px); }
.auth-submit svg { width: 18px; height: 18px; transition: transform 0.15s ease; }
.auth-submit:hover svg { transform: translateX(3px); }

.auth-form-footnote {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--auth-muted);
  text-align: center;
  line-height: 1.6;
}

/* Visible keyboard focus throughout */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--auth-cyan-dim);
  outline-offset: 2px;
}

/* ---------------- Responsive: mobile-friendly ---------------- */

@media (max-width: 880px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .auth-stage {
    min-height: 200px;
    padding-top: 8px;
  }
  .auth-stage-content { position: relative; padding-bottom: 20px; }
  .auth-form-side { border-radius: 18px 18px 0 0; }
}

@media (max-width: 480px) {
  .auth-form-side { padding: 26px 20px 32px; }
  .auth-stage-content { padding: 18px; padding-bottom: 16px; }
  .auth-form-heading { font-size: 24px; }
}