/* ==========================================================================
   SURVIVAL SHOWDOWN - ABANDONED HOSPITAL / PSYCHOLOGICAL THRILLER THEME
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Special+Elite&family=Space+Grotesk:wght@400;500;600;700&family=Cinzel:wght@700;900&display=swap');

:root {
  --bg-abyss: #070A0B;
  --bg-decay: #0E1315;
  --bg-concrete: #141B1E;
  --bg-surface: #1B2326;
  --bg-surface-elevated: #242E32;
  --bg-clip-header: #2B373C;

  --border-rust: #443328;
  --border-decay: #2A363B;
  --border-active: #3D5A50;
  --border-crimson: #7A1E1E;

  --surgical-green: #2D5A4C;
  --surgical-green-glow: #3E8A72;
  --surgical-green-light: #52B799;
  --surgical-green-dim: rgba(45, 90, 76, 0.2);

  --blood-crimson: #8B0000;
  --blood-crimson-bright: #DC2626;
  --blood-crimson-dark: #5A1212;
  --blood-crimson-dim: rgba(139, 0, 0, 0.22);

  --caution-amber: #D97706;
  --caution-amber-glow: #F59E0B;
  --caution-amber-dim: rgba(217, 119, 6, 0.18);

  --text-bone: #EAEFF2;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-dark: #0F1416;

  --font-mono: 'Share Tech Mono', monospace;
  --font-typewriter: 'Special Elite', cursive, monospace;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-display: 'Cinzel', serif;

  --shadow-distress: 0 10px 30px -10px rgba(0, 0, 0, 0.8), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-green-glow: 0 0 20px -5px rgba(62, 138, 114, 0.45);
  --shadow-crimson-glow: 0 0 20px -5px rgba(220, 38, 38, 0.45);
}

/* Base Reset & Background */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-abyss);
  color: var(--text-bone);
  font-family: var(--font-sans);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Ambient Background Atmosphere */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 50% 10%, rgba(45, 90, 76, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 90% 80%, rgba(122, 30, 30, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(217, 119, 6, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, rgba(7, 10, 11, 0.85) 0%, rgba(14, 19, 21, 0.95) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.3) 2px, rgba(0, 0, 0, 0.3) 4px);
  pointer-events: none;
  z-index: 0;
}

/* Subtle CRT Grain / Vignette */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 1;
}

.content-wrapper {
  position: relative;
  z-index: 2;
}

/* Typography Helpers */
.font-mono { font-family: var(--font-mono); }
.font-typewriter { font-family: var(--font-typewriter); }
.font-display { font-family: var(--font-display); }

/* Hazard Stripes */
.hazard-stripe {
  background: repeating-linear-gradient(
    -45deg,
    #1F2426,
    #1F2426 10px,
    #D97706 10px,
    #D97706 20px
  );
}

.hazard-stripe-crimson {
  background: repeating-linear-gradient(
    -45deg,
    #14191B,
    #14191B 8px,
    #7A1E1E 8px,
    #7A1E1E 16px
  );
}

/* Distressed Clipboard Card */
.clipboard-card {
  background: linear-gradient(175deg, var(--bg-surface-elevated) 0%, var(--bg-surface) 15%, var(--bg-decay) 100%);
  border: 1px solid var(--border-decay);
  border-radius: 4px;
  position: relative;
  box-shadow: var(--shadow-distress);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clipboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--border-rust), var(--surgical-green), var(--border-rust));
  opacity: 0.7;
}

.clipboard-clip {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 26px;
  background: linear-gradient(180deg, #5A656B 0%, #2A3337 60%, #151A1C 100%);
  border: 1px solid #718087;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.clipboard-clip::after {
  content: "";
  width: 50px;
  height: 6px;
  background: #111618;
  border-radius: 3px;
  border: 1px solid #48555C;
}

/* Weathered Tape Marker */
.medical-tape {
  position: absolute;
  background: rgba(220, 214, 195, 0.12);
  border-top: 1px dashed rgba(220, 214, 195, 0.3);
  border-bottom: 1px dashed rgba(220, 214, 195, 0.3);
  color: #D6CEBE;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 2px 12px;
  pointer-events: none;
  z-index: 4;
}

/* Form Controls & Clinical Inputs */
.clinical-input-group {
  position: relative;
}

.clinical-input {
  width: 100%;
  background: rgba(14, 19, 21, 0.85);
  border: 1px solid #2B383D;
  border-radius: 3px;
  color: var(--text-bone);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  transition: all 0.25s ease;
  outline: none;
}

.clinical-input:focus {
  border-color: var(--surgical-green-glow);
  box-shadow: 0 0 0 2px var(--surgical-green-dim), inset 0 1px 3px rgba(0,0,0,0.5);
  background: rgba(18, 25, 28, 0.95);
}

.clinical-input.invalid {
  border-color: var(--blood-crimson-bright) !important;
  box-shadow: 0 0 0 2px var(--blood-crimson-dim) !important;
  background: rgba(45, 12, 12, 0.25) !important;
}

.input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  transition: color 0.2s ease;
  pointer-events: none;
}

.clinical-input:focus + .input-icon,
.clinical-input-group:focus-within .input-icon {
  color: var(--surgical-green-light);
}

.clinical-input.invalid ~ .input-icon {
  color: var(--blood-crimson-bright);
}

/* Rubber Stamp Styling */
.stamp-seal {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  text-transform: uppercase;
  font-family: var(--font-typewriter);
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: 3px;
  transform: rotate(-1.5deg);
  position: relative;
  user-select: none;
}

.stamp-green {
  color: #6EE7B7;
  border: 2px solid #059669;
  background: rgba(6, 78, 59, 0.35);
  box-shadow: inset 0 0 10px rgba(5, 150, 105, 0.2), 0 0 15px rgba(16, 185, 129, 0.15);
}

.stamp-crimson {
  color: #FCA5A5;
  border: 2px solid #DC2626;
  background: rgba(153, 27, 27, 0.35);
  box-shadow: inset 0 0 10px rgba(220, 38, 38, 0.2), 0 0 15px rgba(220, 38, 38, 0.2);
}

.stamp-amber {
  color: #FCD34D;
  border: 2px solid #D97706;
  background: rgba(180, 83, 9, 0.3);
  box-shadow: inset 0 0 10px rgba(217, 119, 6, 0.2);
}

/* Team Size Tile Selector */
.team-size-tile {
  background: rgba(18, 25, 28, 0.7);
  border: 1px solid var(--border-decay);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.team-size-tile:hover {
  border-color: #485A60;
  background: rgba(28, 38, 42, 0.9);
  transform: translateY(-2px);
}

.team-size-tile.active {
  border-color: var(--surgical-green-light);
  background: linear-gradient(180deg, rgba(45, 90, 76, 0.4) 0%, rgba(20, 30, 32, 0.9) 100%);
  box-shadow: 0 0 15px rgba(45, 90, 76, 0.35), inset 0 0 10px rgba(82, 183, 153, 0.2);
}

.team-size-tile.active .tile-number {
  color: #6EE7B7;
  text-shadow: 0 0 8px rgba(110, 231, 183, 0.6);
}

.team-size-tile.active::after {
  content: "ACTIVE";
  position: absolute;
  bottom: 3px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--surgical-green-light);
  letter-spacing: 0.1em;
}

/* Pulse Animations */
@keyframes heartPulse {
  0% { transform: scale(1); opacity: 0.8; }
  15% { transform: scale(1.15); opacity: 1; }
  30% { transform: scale(1); opacity: 0.9; }
  45% { transform: scale(1.08); opacity: 1; }
  60% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0.8; }
}

.pulse-dot {
  animation: heartPulse 2.2s infinite ease-in-out;
}

/* Flicker effect for emergency warning */
@keyframes emergencyFlicker {
  0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
    opacity: 0.99;
  }
  20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
    opacity: 0.4;
  }
}

.flicker-ambient {
  animation: emergencyFlicker 6s infinite;
}

/* Member Sub-Form Cards */
.member-subcard {
  background: rgba(14, 20, 22, 0.85);
  border: 1px dashed #314045;
  border-left: 3px solid var(--surgical-green);
  border-radius: 3px;
  padding: 1.25rem;
  position: relative;
  transition: all 0.3s ease;
}

.member-subcard:hover {
  border-color: #4B636C;
  border-left-color: var(--surgical-green-light);
}

/* Primary Action Buttons */
.btn-emergency {
  background: linear-gradient(180deg, #8B0000 0%, #5A1212 100%);
  color: #FFF;
  border: 1px solid #B91C1C;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1.8rem;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.btn-emergency:hover {
  background: linear-gradient(180deg, #A81B1B 0%, #6E1414 100%);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5), 0 0 10px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-emergency:active {
  transform: translateY(1px);
}

.btn-surgical {
  background: linear-gradient(180deg, #2D5A4C 0%, #1A362D 100%);
  color: #E2E8F0;
  border: 1px solid #3E7A67;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(45, 90, 76, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-surgical:hover {
  background: linear-gradient(180deg, #3A7261 0%, #22473C 100%);
  border-color: #52B799;
  box-shadow: 0 0 15px rgba(82, 183, 153, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #334147;
  font-family: var(--font-mono);
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-bone);
  border-color: #64748B;
}

/* Modal Dialog System */
dialog.intake-dialog {
  background: transparent;
  border: none;
  padding: 0;
  margin: auto;
  max-width: 740px;
  width: 94%;
  color: var(--text-bone);
}

dialog.intake-dialog::backdrop {
  background: rgba(4, 7, 8, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dossier-modal-content {
  background: linear-gradient(175deg, #1C2428 0%, #131A1C 50%, #0D1214 100%);
  border: 1px solid #3E4E54;
  border-radius: 6px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 2px 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.dossier-watermark {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 900;
  color: rgba(139, 0, 0, 0.07);
  letter-spacing: 0.2em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  user-select: none;
}

/* Registration Ticket Pass */
.survival-ticket {
  background: linear-gradient(135deg, #182023 0%, #101618 100%);
  border: 2px dashed #41535A;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8);
  overflow: hidden;
}

.ticket-notch-left, .ticket-notch-right {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  background-color: var(--bg-abyss);
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 10;
  border: 2px dashed #41535A;
}

.ticket-notch-left { left: -14px; }
.ticket-notch-right { right: -14px; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0A0E10;
}

::-webkit-scrollbar-thumb {
  background: #28353A;
  border-radius: 2px;
  border: 1px solid #141B1E;
}

::-webkit-scrollbar-thumb:hover {
  background: #3B4D54;
}

/* Radio Custom Card */
.matchmaking-option {
  position: relative;
  cursor: pointer;
}

.matchmaking-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.matchmaking-card {
  background: rgba(14, 20, 22, 0.8);
  border: 1px solid #2B383D;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.matchmaking-radio-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid #4A5B62;
  border-radius: 50%;
  margin-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.matchmaking-radio-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  background: transparent;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.matchmaking-option input[type="radio"]:checked + .matchmaking-card {
  border-color: var(--caution-amber-glow);
  background: rgba(40, 28, 12, 0.4);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.25);
}

.matchmaking-option input[type="radio"]:checked + .matchmaking-card .matchmaking-radio-indicator {
  border-color: var(--caution-amber-glow);
}

.matchmaking-option input[type="radio"]:checked + .matchmaking-card .matchmaking-radio-indicator::after {
  background: var(--caution-amber-glow);
}

/* Print Styles */
@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  body::before, body::after, .no-print, header, footer, #regFormContainer, #dossierModal, #endpointModal {
    display: none !important;
  }
  #successView {
    display: block !important;
  }
  .survival-ticket {
    background: #FFF !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .text-bone, .text-muted, .text-dim {
    color: #111 !important;
  }
  .stamp-seal {
    border: 2px solid #000 !important;
    color: #000 !important;
    background: #EEE !important;
  }
}
