/* NATURIZE AI - HOME MASTER */
:root {
  --bg: #0f1220; --card: #171a2b; --card-light: #1f2340;
  --primary: #7c8cff; --primary-hover: #6a7cff;
  --text: #e6e8f0; --muted: #a0a4c0;
  --border: rgba(255, 255, 255, 0.08); --radius: 16px;
}

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

/* 1. SOLUCIÓN SCROLL: Solo reservamos espacio en escritorio para no romper la Nav */
@media (min-width: 769px) {
  html {
    scrollbar-gutter: stable;
  }
}

html { 
  overflow-x: hidden; 
  width: 100%;
}

body {
  min-height: 100vh; 
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1a1f3d 0%, transparent 60%),
              radial-gradient(1000px 500px at 80% 10%, #22286b 0%, transparent 55%), var(--bg);
  color: var(--text); 
  display: flex; 
  flex-direction: column;
  overflow-x: hidden;
  /* El scroll vertical aparecerá SOLO cuando el contenido sea más alto que la pantalla */
  overflow-y: auto; 
}

/* Contenedor principal ajustado para evitar empujes */
.container {
  flex: 1; 
  width: 100%; 
  max-width: 1000px; 
  margin: 0 auto;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  padding: 32px 24px;
  box-sizing: border-box;
}

.header { text-align: center; margin-bottom: 28px; }
.logo { font-size: 36px; font-weight: 700; letter-spacing: -0.5px; }
.tagline { margin-top: 8px; color: var(--muted); font-size: 16px; }

.card {
  width: 100%; 
  background: linear-gradient(180deg, var(--card-light), var(--card));
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

textarea {
  width: 100%; min-height: 200px; resize: vertical; background: #0c0f1f;
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  color: var(--text); font-size: 15px; line-height: 1.6; outline: none; font-family: inherit;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,140,255,0.15); }

/* ACCIONES */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.hint { font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; 
  background: linear-gradient(135deg, var(--primary), #9aa7ff);
  color: #0b0e1a; border: none; border-radius: 999px; padding: 12px 24px; 
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; 
  box-shadow: 0 8px 30px rgba(124,140,255,0.35); text-decoration: none;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(124,140,255,0.45); }

.btn-spinner {
  display: none; 
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1); 
  border-top-color: var(--primary); 
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* CAJA DE SALIDA */
.output-box { 
  background: #0c0f1f; 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  padding: 24px 28px; 
  margin-top: 10px; 
  white-space: pre-wrap; 
  word-break: break-word; 
  line-height: 1.6;
  color: var(--text);
}

.output-box ol, .output-box ul {
  padding-left: 20px; 
  margin: 15px 0;
  list-style-position: outside;
}

.output-box li { margin-bottom: 8px; }
.output-box h2 { font-size: 1.2rem; margin-bottom: 12px; color: var(--primary); }

.error { margin-top: 20px; background: rgba(255, 80, 80, 0.1); border: 1px solid rgba(255, 80, 80, 0.3); color: #ffb4b4; padding: 14px; border-radius: 12px; }

footer { 
  text-align: center; 
  padding: 30px 0; 
  color: var(--muted); 
  font-size: 13px; 
  margin-top: auto; 
  border-top: 1px solid var(--border);
  width: 100%;
}

/* AJUSTES MÓVILES */
@media (max-width: 600px) {
  .logo { font-size: 30px; }
  .container { padding: 32px 16px; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn-group { flex-direction: column-reverse; } 
  .btn { width: 100%; justify-content: center; }
  .hint { text-align: center; order: 2; }
}