/* Design Tokens & Theme Setup */
:root {
  --bg-primary: #050508;
  --bg-secondary: rgba(10, 15, 25, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(52, 211, 153, 0.5); /* Green accent */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --accent-cyan: #34d399;     /* FSC Green (overriding old cyan) */
  --accent-green: #34d399;    /* FSC Emerald Green */
  --accent-glow: rgba(52, 211, 153, 0.15);
  
  --success-color: #34d399;
  --error-color: #ef4444;
  
  --font-display: 'Orbitron', monospace;  /* FSC Font */
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Retro Terminal Grid Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(52, 211, 153, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 211, 153, 0.012) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  z-index: 1;
  pointer-events: none;
}

/* CRT monitor scanlines and subtle pulse overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(5, 5, 8, 0.18),
    rgba(5, 5, 8, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 9999;
  pointer-events: none;
  animation: monitor-glow 6s ease-in-out infinite;
}

@keyframes monitor-glow {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 0.96; }
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Glowing Background Orbs (FSC Green shades) */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.25;
}

.glow-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-green) 0%, transparent 75%);
  top: -10%;
  left: -10%;
}

.glow-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-green) 0%, transparent 75%);
  bottom: -15%;
  right: -10%;
}

.glow-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.18) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Main Layout Container */
.landing-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
}

/* Header & Logo */
.header {
  width: 100%;
  display: flex;
  justify-content: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-symbol {
  color: #ffffff;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.6);
  font-size: 1.2rem;
}

.logo-accent {
  color: var(--accent-cyan);
  font-weight: 800;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

/* Countdown Readout Section (FSC Timer format with Console Telemetry decoration) */
.countdown-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px dashed rgba(52, 211, 153, 0.15);
  border-bottom: 1px dashed rgba(52, 211, 153, 0.15);
  padding: 10px 0;
  position: relative;
}

.countdown-section::before,
.countdown-section::after {
  content: "";
  position: absolute;
  top: -6px;
  width: 12px;
  height: 12px;
  border-color: rgba(52, 211, 153, 0.4);
  border-style: solid;
  pointer-events: none;
}

.countdown-section::before {
  left: 8%;
  border-width: 0 1px 1px 0;
}

.countdown-section::after {
  right: 8%;
  border-width: 0 0 1px 1px;
}

.countdown-readout {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  user-select: none;
  padding: 15px 0;
}

.timer-char {
  display: inline-block;
  text-align: center;
}

.timer-char.prefix {
  color: #ffffff;
}

/* Width mapping matching FSC tabular layouts */
.timer-char.prefix:nth-child(1) {
  width: 0.82em; /* 'T' width */
}

.timer-char.prefix:nth-child(2) {
  width: 0.48em; /* '-' width */
}

.timer-char.colon {
  width: 0.42em; /* ':' width */
  color: var(--accent-green);
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.55);
}

.timer-char.digit {
  width: 0.80em; /* digit width */
  color: var(--accent-green);
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.55);
}

/* Signup Form Card */
.signup-section {
  width: 100%;
  max-width: 480px;
}

.signup-card {
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(52, 211, 153, 0.12);
  border-radius: 4px; /* Sharp console border corners */
  padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(52, 211, 153, 0.05);
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  transition: var(--transition-smooth);
}

/* HUD corner brackets */
.signup-card::before,
.signup-card::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 18px;
  border-style: solid;
  border-color: rgba(52, 211, 153, 0.6);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.signup-card::before {
  left: -2px;
  border-width: 2px 0 2px 2px;
}

.signup-card::after {
  right: -2px;
  border-width: 2px 2px 2px 0;
}

.signup-card:hover {
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(52, 211, 153, 0.12);
}

.signup-card:hover::before {
  transform: translateX(-4px);
  border-color: var(--accent-green);
}

.signup-card:hover::after {
  transform: translateX(4px);
  border-color: var(--accent-green);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
  color: var(--text-primary);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 16px; /* Spacing between top absolute close button and first field */
}

.form-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  z-index: 10;
}

.form-close:hover {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
  transform: scale(1.15);
}

.input-group {
  display: flex;
  flex-direction: column;
}

.form-input {
  background: rgba(5, 5, 8, 0.6);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 4px; /* Sharp console corners */
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 18px;
  width: 100%;
  caret-color: var(--accent-green); /* Green console caret */
  transition: var(--transition-smooth);
}

.form-input::placeholder {
  color: rgba(52, 211, 153, 0.3); /* Green tinted placeholders */
}

.form-input:focus {
  outline: none;
  background: rgba(52, 211, 153, 0.03);
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.submit-button {
  background: var(--accent-green);
  border: none;
  border-radius: 4px; /* Sharp console corners */
  color: #050508; /* Dark text for contrast against solid green */
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.25);
  transition: var(--transition-smooth);
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(52, 211, 153, 0.4);
}

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

/* Spinner Loader */
.button-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(5, 5, 8, 0.3);
  border-top-color: #050508;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Feedback Alerts */
.feedback-alert {
  padding: 14px 18px;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap; /* Keeps multiple consecutive spaces from collapsing */
  animation: fadeIn 0.3s ease-out;
}

.feedback-alert.success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--success-color);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

.feedback-alert.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error-color);
}

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

/* Footer */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 24px;
  letter-spacing: 0.05em;
}

/* Accessibility classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Custom Radio Buttons */
.radio-group-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0;
}

.radio-group-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.radio-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
  transition: var(--transition-smooth);
}

.radio-label input[type="radio"] {
  display: none;
}

.custom-radio {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  transition: var(--transition-smooth);
}

.radio-label input[type="radio"]:checked + .custom-radio {
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

.custom-radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 0 8px var(--accent-green);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.radio-label input[type="radio"]:checked + .custom-radio::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label input[type="radio"]:checked ~ .label-text {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.15);
}

/* Responsive Breakpoints */
@media (max-width: 600px) {
  .landing-container {
    padding: 40px 16px;
    gap: 40px;
  }
  
  .signup-card {
    padding: 32px 20px;
  }
}
