/* =========================================
   VARIABLES & THEME CONFIGURATION
   ========================================= */
:root {
  /* Paleta de Colores - Tema "Green Meadows" Profesional */
  --primary-color: #276749;       /* Verde bosque profundo */
  --primary-hover: #1c4a34;       /* Verde más oscuro para interacciones */
  --primary-light: #f0fdf4;       /* Fondo muy claro verde */
  --secondary-bg: #ffffff;        /* Fondo tarjetas */
  --page-bg: #f3f4f6;             /* Fondo página (gris suave) */
  
  --text-main: #1f2937;           /* Texto principal (casi negro) */
  --text-muted: #6b7280;          /* Texto secundario (gris) */
  --border-color: #e5e7eb;        /* Bordes sutiles */
  --border-focus: #276749;        /* Borde al hacer foco */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius: 8px;                  /* Radio de bordes estándar */
  --transition: all 0.2s ease-in-out;
}

/* =========================================
   GLOBAL STYLES
   ========================================= */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif; /* Tipografía moderna */
  background-color: var(--page-bg);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Contenedor Principal */
.assessment-container {
  padding: 3rem 1rem;
  min-height: 100vh;
}

.max-w-4xl {
  max-width: 900px;
  margin: 0 auto;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1, h2, h3 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.text-center { text-align: center; }
.mb-8 { margin-bottom: 2rem; }
.text-3xl { font-size: 2rem; line-height: 2.25rem; }

/* Subtítulos o descripciones */
.text-sm { font-size: 0.875rem; }
.text-muted-foreground { color: var(--text-muted); }

/* =========================================
   COMPONENTS: CARDS
   ========================================= */
.card {
  background: var(--secondary-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: transform 0.2s ease;
}

/* Encabezados de Tarjetas */
.card-header {
  background: var(--primary-color);
  color: white;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-content {
  padding: 2rem;
}

/* =========================================
   COMPONENTS: FORMS & INPUTS
   ========================================= */
.input, .textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-main);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  transition: var(--transition);
  box-sizing: border-box;
}

.input:focus, .textarea:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 103, 73, 0.2);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* =========================================
   COMPONENTS: BUTTONS
   ========================================= */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.button-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 6px rgba(39, 103, 73, 0.25);
}

.button-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 8px rgba(39, 103, 73, 0.3);
}

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

.buttons-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-bottom: 2rem;
}

/* =========================================
   ASSESSMENT GRID (MAIN OPTIONS)
   ========================================= */
.activity-row {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.activity-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.label {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827; /* Negro suave */
  margin-bottom: 1rem;
}

/* Rejilla de opciones */
.options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columnas iguales */
  gap: 1rem;
}

.option-wrapper {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Botones de Opción Principal (Independent, Minimal, etc.) */
.option-btn {
  background-color: #fff;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.85rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.option-btn:hover:not(:disabled) {
  border-color: #a7f3d0;
  background-color: #ecfdf5;
  color: var(--primary-color);
}

.option-btn.selected {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--primary-color); /* Doble borde visual */
}

.option-btn:disabled, .option-btn.disabled-spacer {
  background: transparent;
  border-color: transparent;
  cursor: default;
  color: transparent;
  pointer-events: none;
}

/* Badge circular con el puntaje dentro del botón */
.score-badge {
  background-color: var(--primary-color);
  color: white;
  border-radius: 9999px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* =========================================
   SUB-OPTIONS (RANGE SELECTION UI)
   ========================================= */
.sub-options-container {
  margin-top: 0.75rem;
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  animation: slideDownFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* Triangulito decorativo arriba del sub-menú */
.sub-options-container::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #d1fae5;
  border-top: 1px solid #d1fae5;
  rotate: 45deg;
}

.sub-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.05);
}

.sub-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

/* =========================================
   COST DISPLAY (DASHBOARD STYLE)
   ========================================= */
#monthly-cost-container {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
  border: 1px solid #bbf7d0;
}

#monthly-cost-container .card-content {
  padding: 2.5rem;
}

#monthly-cost-container h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid #bbf7d0;
  padding-bottom: 0.5rem;
  display: inline-block;
}

.flex { display: flex; }
.justify-between { justify-content: space-between; }
.space-y-2 > * + * { margin-top: 0.75rem; }

.text-xl { font-size: 1.25rem; font-weight: 700; }
.border-t { border-top: 1px solid #d1d5db; padding-top: 1rem; margin-top: 1rem; }

/* =========================================
   LOGIN SCREEN
   ========================================= */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--page-bg);
  padding: 1rem;
}

.login-container .card {
  width: 100%;
  max-width: 400px;
  padding: 0; /* Padding handled by card-content inside */
  margin: 0;
  border: none;
  box-shadow: var(--shadow-lg);
}

.login-container .card-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: transparent;
  color: var(--primary-color);
  border: none;
}

.login-container h1 {
  font-size: 1.75rem;
}

.login-container form {
  padding: 0 2rem 2.5rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.text-red-500 {
  color: #ef4444;
  font-size: 0.875rem;
  text-align: center;
  background: #fef2f2;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #fee2e2;
}

.hidden { display: none !important; }

/* =========================================
   RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets/móvil grande */
  }
  
  .card-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr; /* 1 columna en móviles pequeños */
  }

  .text-3xl {
    font-size: 1.75rem;
  }
  
  .sub-buttons {
    gap: 0.25rem;
  }
  
  .sub-btn {
    width: 32px;
    height: 32px;
  }
}