:root {
  --huelva-blue: #005eb8;
  --trocheria-orange: #f97316;
  --malaja-indigo: #4338ca;
}

body {
  font-family: 'Outfit', sans-serif;
}

h1,
h2,
h3,
.serif-font {
  font-family: 'Merriweather', serif;
}

.hero-bg {
  background: radial-gradient(circle at top right, #f1f5f9 0%, #ffffff 50%), linear-gradient(135deg, #e0f2fe 0%, #ffffff 100%);
}

.term-card {
  transition: all 0.3s ease;
}

.term-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Custom Scrollbar for Table */
.custom-scrollbar::-webkit-scrollbar {
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- VARIABLES & RESET (Igual que index.html) --- */
:root {
  --primary: #6366f1;
  /* Indigo - Malajá */
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #f97316;
  /* Orange - Trochería */
  --secondary-dark: #c2410c;
  --secondary-light: #ffedd5;
  --bg: #f8fafc;
  --text: #1e293b;
  --white: #ffffff;
  --radius: 24px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* --- LAYOUT --- */
.diagnosis-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 40px 0;
}

/* --- HEADER --- */
header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 20px;
  margin: 0 20px 40px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
}

.logo {
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
}

.back-link {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
}

/* --- FORM STYLES --- */
.test-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
  margin-bottom: 40px;
}

h1 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(135deg,
      var(--secondary) 0%,
      var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-text {
  text-align: center;
  margin-bottom: 40px;
  color: #64748b;
}

.question-block {
  margin-bottom: 40px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 30px;
}

.question-block:last-child {
  border-bottom: none;
}

.question-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* Custom Radio Buttons styling */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.option-label {
  display: block;
  padding: 20px;
  background: #f1f5f9;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  border: 2px solid transparent;
}

.option-label:hover {
  transform: translateY(-3px);
}

/* Hide actual radio input */
input[type="radio"] {
  display: none;
}

/* Selection States */
/* If it's a "trocheria" option (value A) */
input[value="A"]:checked+.option-label {
  background: var(--secondary-light);
  border-color: var(--secondary);
  color: var(--secondary-dark);
}

/* If it's a "malaja" option (value B) */
input[value="B"]:checked+.option-label {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* --- BUTTON --- */
.submit-btn {
  width: 100%;
  padding: 20px;
  font-size: 1.2rem;
  font-weight: 900;
  color: white;
  background: var(--text);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  margin-top: 20px;
}

.submit-btn:hover {
  transform: scale(1.02);
  background: black;
}

/* --- RESULT BOX (Hidden by default) --- */
#result-box {
  display: none;
  /* Hidden initially */
  text-align: center;
  background: var(--text);
  color: var(--white);
  border-radius: var(--radius);
  padding: 60px 40px;
  margin-top: 40px;
  animation: fadeIn 0.5s ease;
}

#result-title {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--secondary);
}

#result-desc {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

.loading-spinner {
  display: none;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--secondary);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }
}