/* ============================================================
   Be Secure: The Awakening Journey — Survey
   Matrix theme
   ============================================================ */

:root {
  --green:        #00FF41;
  --green-dim:    #00CC33;
  --green-glow:   rgba(0, 255, 65, 0.5);
  --green-faint:  rgba(0, 255, 65, 0.08);
  --green-line:   rgba(0, 255, 65, 0.18);
  --bg:           #000000;
  --bg-card:      rgba(0, 10, 5, 0.85);
  --bg-card-2:    rgba(0, 20, 10, 0.6);
  --text:         #C8FFD4;
  --text-dim:     #5A8A6A;
  --amber:        #FFB000;
  --amber-faint:  rgba(255, 176, 0, 0.08);
  --red:          #FF3030;
  --cyan:         #22D3EE;
  --font-mono:    'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow-x: hidden;
}

body { line-height: 1.5; }

/* Matrix rain canvas — sits behind everything */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* CRT scanlines overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.12) 3px,
    rgba(0,0,0,0) 4px
  );
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: multiply;
}

/* Main content wrapper */
.shell {
  position: relative;
  z-index: 10;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
}

/* ─── Language toggle ─── */
.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--green-line);
  padding: 4px;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.lang-toggle button.active {
  color: var(--green);
  text-shadow: 0 0 8px var(--green-glow);
}
.lang-toggle button:hover { color: var(--green); }

/* ─── Screens ─── */
.screen {
  display: none;
  animation: fadeIn 0.6s ease forwards;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Intro screen ─── */
.intro {
  text-align: center;
  padding-top: 5vh;
}
.intro-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  color: var(--green-dim);
  text-transform: uppercase;
  margin-bottom: 28px;
  opacity: 0.85;
  line-height: 1.5;
  padding: 0 8px;
}
@media (max-width: 640px) {
  .intro-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
  }
}

/* Terminal output (typewriter intro) */
.terminal {
  font-family: var(--font-mono);
  text-align: left;
  max-width: 620px;
  margin: 0 auto 28px;
  line-height: 1.6;
  min-height: 55vh;
  padding: 12px 4px;
}
.term-line {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
  margin: 0;
  min-height: 1.6em;
  line-height: 1.55;
}
.term-line.system {
  color: var(--green);
  text-shadow: 0 0 6px var(--green-glow);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.term-line.morpheus {
  color: var(--green);
  text-shadow: 0 0 14px var(--green-glow);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.4rem;
}
.term-line.morpheus.big {
  font-size: clamp(1.9rem, 5.5vw, 2.6rem);
  letter-spacing: 0.04em;
  margin: 14px 0;
  text-shadow: 0 0 22px var(--green-glow);
}
.term-line.message {
  color: var(--text);
  font-size: 1.2rem;
  padding-left: 0;
}
.term-line.spacer {
  height: 0.5em;
  min-height: 0.5em;
}
.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--green);
  vertical-align: text-bottom;
  margin-left: 3px;
  animation: blink 0.9s step-end infinite;
  box-shadow: 0 0 10px var(--green-glow);
}
.term-cursor.big {
  height: 1.1em;
  width: 0.45em;
}

/* CTA button — hidden until typewriter finishes */
#intro-cta {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: translateY(10px);
  margin-bottom: 28px;
}
#intro-cta.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Skip hint — appears at bottom while typing */
.intro-skip-hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 30;
  white-space: nowrap;
}
.intro-skip-hint.visible {
  opacity: 0.55;
}

.intro-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.intro-meta.visible { opacity: 1; }
.intro-meta span::before {
  content: '▸ ';
  color: var(--green);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  padding: 14px 32px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  text-decoration: none;
}
.btn:hover {
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 24px var(--green-glow);
}
.btn:active { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.btn::before { content: '['; opacity: 0.6; }
.btn::after  { content: ']'; opacity: 0.6; }
.btn-primary {
  background: var(--green-faint);
}
.btn-ghost {
  border-color: var(--green-line);
  color: var(--text-dim);
}
.btn-ghost:hover {
  background: var(--green-faint);
  color: var(--green);
  box-shadow: none;
}

/* ─── Progress bar ─── */
.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, var(--bg) 70%, rgba(0,0,0,0));
  padding: 12px 0 18px;
  margin: -40px -20px 24px;
  padding-left: 20px;
  padding-right: 20px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.progress-label .count { color: var(--green); }
.progress-bar {
  height: 4px;
  background: var(--green-faint);
  position: relative;
  overflow: hidden;
}
.progress-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
  width: 0%;
  transition: width 0.4s ease;
}

/* ─── Question card ─── */
.q-card {
  background: var(--bg-card);
  border: 1px solid var(--green-line);
  padding: 24px 22px 20px;
  margin-bottom: 18px;
  position: relative;
  backdrop-filter: blur(2px);
}
.q-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
}
.q-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 14px;
  height: 14px;
  border-bottom: 2px solid var(--green);
  border-right: 2px solid var(--green);
}
.q-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.q-num {
  font-size: 0.78rem;
  color: var(--green);
  letter-spacing: 0.2em;
  font-weight: 700;
}
.q-text {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 400;
  margin: 0;
  flex: 1;
}

/* ─── Rating options ─── */
.rating {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rate-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 1px solid var(--green-line);
  color: var(--text);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
}
.rate-btn:hover {
  border-color: var(--green);
  background: var(--green-faint);
}
.rate-btn.selected {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.14);
  box-shadow: inset 0 0 12px rgba(0, 255, 65, 0.18);
  color: var(--green);
}
.rate-icon {
  display: inline-flex;
  gap: 2px;
  width: 70px;
  flex-shrink: 0;
}
.rate-icon .sq {
  width: 10px;
  height: 10px;
  border: 1px solid var(--green-dim);
  background: transparent;
  transition: all 0.18s;
}
.rate-icon .sq.fill {
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}
.rate-btn:hover .rate-icon .sq { border-color: var(--green); }
.rate-label { flex: 1; }

.opt-divider {
  height: 1px;
  background: var(--green-line);
  margin: 12px 0;
  position: relative;
}
.opt-divider::before {
  content: '— — —';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  padding: 0 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
}

.rate-btn.opt-out {
  border-color: rgba(255, 176, 0, 0.3);
  color: var(--amber);
  background: var(--amber-faint);
}
.rate-btn.opt-out:hover {
  border-color: var(--amber);
  background: rgba(255, 176, 0, 0.14);
}
.rate-btn.opt-out.selected {
  border-color: var(--amber);
  background: rgba(255, 176, 0, 0.18);
  color: var(--amber);
  box-shadow: inset 0 0 12px rgba(255, 176, 0, 0.18);
}
.rate-btn.opt-out .rate-icon .sq {
  border-color: rgba(255, 176, 0, 0.5);
}
.rate-btn.opt-out.selected .rate-icon .sq,
.rate-btn.opt-out:hover .rate-icon .sq {
  border-color: var(--amber);
}
.rate-btn.opt-out .rate-icon .sq.dash {
  border: none;
  background: var(--amber);
  height: 2px;
  margin: 4px 0;
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

/* ─── Text question ─── */
.text-area {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--green-line);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 12px 14px;
  min-height: 110px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.text-area:focus {
  border-color: var(--green);
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.18);
}
.text-area::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.char-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
  margin-top: 4px;
  letter-spacing: 0.1em;
}
.char-count.over { color: var(--red); }
.q-optional {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-left: auto;
}

/* ─── Submit area ─── */
.submit-wrap {
  margin-top: 32px;
  text-align: center;
}
.submit-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.submit-hint.error { color: var(--red); }

/* ─── Thanks screen ─── */
.thanks {
  text-align: center;
  padding-top: 12vh;
}
.thanks-icon {
  font-size: 3.5rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 20px var(--green-glow));
}
.thanks-title {
  font-size: 2rem;
  color: var(--green);
  text-shadow: 0 0 18px var(--green-glow);
  margin: 0 0 14px;
  letter-spacing: 0.05em;
}
.thanks-msg {
  font-size: 1rem;
  color: var(--text);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.7;
}
.thanks-sig {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 40px;
}

/* ─── Footer ─── */
.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  padding: 24px 0 16px;
  text-transform: uppercase;
}

/* ─── Cursor blink ─── */
.cursor::after {
  content: '_';
  color: var(--green);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ─── Mobile ─── */
@media (max-width: 600px) {
  .shell { padding: 30px 14px 60px; }
  .progress-wrap { margin: -30px -14px 20px; padding-left: 14px; padding-right: 14px; }
  .q-card { padding: 20px 16px 16px; }
  .intro-body { padding-left: 14px; }
  .rate-icon { width: 56px; }
  .rate-icon .sq { width: 8px; height: 8px; }
  .rate-btn { font-size: 0.86rem; padding: 9px 12px; }
}
