/* Full-black layout with center positioning and a subtle neon effect */
:root {
  --fg: #f5f7ff;
  --muted: #a5afc7;
  --accent: #5df3ff;
  --accent-strong: #7d5bff;
  --surface: rgba(7, 11, 28, 0.92);
  --surface-alt: rgba(11, 15, 33, 0.9);
  --panel-bg: rgba(8, 12, 29, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --success: #36ebb5;
  --danger: #ff7d8a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: radial-gradient(circle at top, #0a1024, #02060f 45%, #010104 85%);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(93, 243, 255, 0.22), rgba(93, 243, 255, 0));
  top: -120px;
  left: -120px;
  z-index: -2;
  filter: blur(0.5px);
}
body::after {
  background: radial-gradient(circle, rgba(125, 91, 255, 0.18), rgba(125, 91, 255, 0));
  top: auto;
  bottom: -140px;
  left: auto;
  right: -120px;
}

#app {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

.quote-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.75ch;
  text-align: center;
  max-width: 1000px;
  line-height: 1.25;
  text-wrap: balance;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.25));
}

.chev {
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.quote {
  font-weight: 600;
  font-size: clamp(24px, 6vw, 56px);
  letter-spacing: 0.2px;
  position: relative;
  isolation: isolate;
}

.cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1em;
  background: var(--accent);
  margin-left: 0.2ch;
  align-self: center;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  opacity: 0.75;
  user-select: none;
}

/* Glitch effect */
.quote::before,
.quote::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0; /* idle: hidden */
}

.quote::before {
  text-shadow: -2px 0 rgba(255, 0, 0, 0.65);
  transform: translateX(0);
}
.quote::after {
  text-shadow: 2px 0 rgba(0, 180, 255, 0.65);
  transform: translateX(0);
}

@keyframes idleShimmer {
  0% { filter: none; }
  50% { filter: brightness(1.02) contrast(1.06); }
  100% { filter: none; }
}
.quote { animation: idleShimmer 6s ease-in-out infinite; }

@keyframes glitchShiftL {
  0% { transform: translateX(0); }
  20% { transform: translateX(-1px); }
  40% { transform: translateX(-3px); }
  60% { transform: translateX(1px); }
  80% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
@keyframes glitchShiftR {
  0% { transform: translateX(0); }
  20% { transform: translateX(1px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

@keyframes sliceJump {
  0%   { clip-path: inset(0 0 0 0); }
  10%  { clip-path: inset(5% 0 65% 0); }
  20%  { clip-path: inset(80% 0 5% 0); }
  30%  { clip-path: inset(15% 0 50% 0); }
  40%  { clip-path: inset(60% 0 20% 0); }
  50%  { clip-path: inset(30% 0 40% 0); }
  60%  { clip-path: inset(10% 0 70% 0); }
  70%  { clip-path: inset(70% 0 10% 0); }
  80%  { clip-path: inset(25% 0 35% 0); }
  90%  { clip-path: inset(50% 0 25% 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.glitch-burst .quote::before,
.glitch-burst .quote::after { opacity: 1; }
.glitch-burst .quote::before {
  animation: glitchShiftL 220ms steps(2, jump-none) infinite,
             sliceJump 300ms steps(6, end) infinite;
}
.glitch-burst .quote::after {
  animation: glitchShiftR 220ms steps(2, jump-none) infinite,
             sliceJump 300ms steps(6, end) reverse infinite;
}

@media (prefers-reduced-motion: reduce) {
  .quote, .quote::before, .quote::after { animation: none !important; }
}

/* === form styles (moved from inline to satisfy CSP) === */
.form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

input[type="tel"] {
  background: #111;
  color: #e6e6e6;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 1rem;
  width: 260px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="tel"]::placeholder { color: #888; }
input[type="tel"]:focus {
  border-color: #00ffff;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
}

button#runTest {
  background: var(--accent);
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  transition: background 0.2s ease, transform 0.1s ease;
}
button#runTest:hover { background: #00ffff; transform: translateY(-2px); }

/* toast notification (for the side message) */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(0, 229, 255, 0.1);
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(0); }

/* ===== Shalom Bait runner - Clean Layout ===== */
.logout-icon {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: all .2s ease;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.logout-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--fg);
  transform: translateY(-1px);
}

.runner-wrap {
  width: min(1400px, 96vw);
  margin-inline: auto;
  padding: clamp(1.5rem, 3vw, 3rem);
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  min-height: 90vh;
}
.runner-wrap.locked {
  filter: grayscale(0.2) blur(3px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
  transition: filter .3s ease, opacity .3s ease;
}

.left-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.page-title {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.5px;
  color: var(--fg);
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.status-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--fg);
}
.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}
.status-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.runner-form {
  background: var(--panel-bg);
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(2, 4, 18, 0.4);
  display: grid;
  gap: 1.25rem;
}
.field-row {
  display: grid;
  gap: .5rem;
}
.field-row label {
  font-size: .85rem;
  letter-spacing: 0.3px;
  color: var(--muted);
  text-transform: uppercase;
}
.field-row input[type="tel"],
.field-row input[type="text"],
.field-row textarea {
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: .9rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field-row textarea { 
  min-height: 100px; 
  resize: vertical;
  font-family: inherit;
}
.field-row input:focus,
.field-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(93, 243, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-top: 0.5rem;
}
.actions button {
  border: none;
  border-radius: 12px;
  padding: .9rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .3px;
  font-family: inherit;
  transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
  font-size: 0.95rem;
}
.actions #runAuto {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #001018;
  box-shadow: 0 10px 25px rgba(93, 243, 255, 0.3);
}
.actions #runAuto:hover { 
  transform: translateY(-2px); 
  filter: brightness(1.1);
  box-shadow: 0 15px 35px rgba(93, 243, 255, 0.4);
}
.actions #runAuto:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.stage-panel {
  background: var(--panel-bg);
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(2, 4, 18, 0.4);
  flex: 1;
}
.stage-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 1.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stage-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 2rem;
}
.stage-list::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}
.stage {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 1rem 1.25rem 1rem 1.5rem;
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}
.stage:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
.stage .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  left: -1.3rem;
  top: 50%;
  transform: translateY(-50%);
  border: 2px solid rgba(4, 7, 24, 0.9);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}
.stage .name {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: .2px;
  font-size: 0.95rem;
}
.stage .desc {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .85rem;
  opacity: .85;
  margin-top: 0.25rem;
}
.stage .status {
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 0.4ch;
  white-space: nowrap;
}

/* status colors */
.s-wait .dot { background: #767fa4; }
.s-run  .dot { background: var(--accent); animation: pulse .9s ease-in-out infinite; }
.s-ok   .dot { background: var(--success); }
.s-fail .dot { background: var(--danger); }
.s-wait .status { color: #8b94b4; }
.s-run  .status { color: var(--accent); }
.s-ok   .status { color: var(--success); }
.s-fail .status { color: var(--danger); }

@keyframes pulse {
  0% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: .9; }
}

@media (max-width: 1100px) {
  .runner-wrap {
    grid-template-columns: 1fr;
  }
  .right-panel {
    order: 2;
  }
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 3, 12, 0.95);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 999;
  transition: opacity .3s ease, visibility .3s ease;
}
.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.auth-card {
  width: min(420px, 92vw);
  background: rgba(8, 12, 29, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 30px 70px rgba(1, 3, 10, 0.7);
}
.auth-card h2 {
  margin: 0 0 2rem 0;
  font-size: 1.8rem;
  color: var(--fg);
  text-align: center;
}
.auth-card form {
  display: grid;
  gap: 1.25rem;
}
.auth-submit {
  border: none;
  border-radius: 12px;
  padding: 1rem;
  font-weight: 700;
  letter-spacing: .4px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #000815;
  box-shadow: 0 12px 30px rgba(93, 243, 255, 0.25);
  transition: transform .15s ease, filter .2s ease;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.auth-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 18px 40px rgba(93, 243, 255, 0.35);
}
.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.auth-error {
  color: var(--danger);
  min-height: 1.2em;
  font-size: .85rem;
  text-align: center;
}