:root {
  --bg-primary: #060913;
  --bg-secondary: #0d1326;
  --bg-card: rgba(18, 26, 47, 0.85);
  --bg-input: rgba(13, 19, 38, 0.9);
  --border-color: rgba(99, 102, 241, 0.2);
  --border-hover: rgba(139, 92, 246, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #a5b4fc;
  --violet-glow: #8b5cf6;
  --danger-color: #f87171;
  --success-color: #34d399;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(1px 1px at 15% 15%, rgba(255, 255, 255, 0.7) 100%, transparent),
    radial-gradient(1.5px 1.5px at 35% 45%, rgba(199, 210, 254, 0.8) 100%, transparent),
    radial-gradient(1px 1px at 60% 25%, rgba(255, 255, 255, 0.6) 100%, transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(165, 180, 252, 0.85) 100%, transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.7) 100%, transparent),
    radial-gradient(1.5px 1.5px at 25% 75%, rgba(199, 210, 254, 0.65) 100%, transparent),
    radial-gradient(1px 1px at 70% 85%, rgba(255, 255, 255, 0.5) 100%, transparent),
    radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 15% 35%, rgba(56, 189, 248, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, auto, auto, auto;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 3rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Genuine SVG Constellation & Starfield Overlay */
.starfield-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.constellation-svg {
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

.star-pulse-slow {
  animation: starTwinkle 4s ease-in-out infinite alternate;
}

.star-pulse-med {
  animation: starTwinkle 2.5s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* Multilingual Navigation Bar & Language Switcher (Text only, no flags/emojis) */
.top-nav-bar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.5rem;
  position: relative;
  z-index: 2;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 26, 47, 0.7);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  color: #ffffff;
}

.lang-btn.active {
  color: var(--accent-light);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lang-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.lang-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  user-select: none;
}

/* Atmospheric Night Sky & Subtle Moon Elements */
.celestial-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.25rem;
  position: relative;
  text-align: center;
}

.moon-symbol {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 16px rgba(165, 180, 252, 0.4));
  transition: transform 0.4s ease;
}

.moon-symbol:hover {
  transform: rotate(-10deg) scale(1.05);
}

.container {
  max-width: 780px;
  width: 100%;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 2.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, #ffffff 20%, #c7d2fe 60%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.25;
}

p.subheadline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto;
}

.card {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.85rem;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  margin-bottom: 2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.pii-warning-badge {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--accent-light);
}

textarea {
  width: 100%;
  height: 170px;
  padding: 1rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.char-counter {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.btn-primary {
  width: 100%;
  padding: 0.95rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  background-color: transparent;
  color: var(--accent-light);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background-color 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
  background-color: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-light);
}

/* Results Content */
#resultsContainer { display: none; }

.section-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.section-block:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.section-content {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.7;
}

ul.symbol-list, ul.bullet-list {
  padding-left: 1.25rem;
  color: #cbd5e1;
  line-height: 1.65;
}

ul.symbol-list li, ul.bullet-list li { margin-bottom: 0.6rem; }

.action-disclaimer-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.4;
}

.disclaimer-box {
  margin-top: 2rem;
  padding: 1.1rem;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
}

.disclaimer-box strong { color: var(--accent-light); }

/* Footer & Legal Links */
footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
  margin-bottom: 1.25rem;
}

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

/* Accessibility: Strict Prefers-Reduced-Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spinner {
    animation: none;
    border-top-color: var(--accent-color);
  }
  .star-pulse-slow,
  .star-pulse-med {
    animation: none !important;
  }
}
