/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* BODY */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe, transparent 55%),
              radial-gradient(circle at bottom right, #dcfce7, transparent 55%),
              #f3f4f6;
  color: #111827;
  min-height: 100vh;
}

/* Layout general */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

/* HEADER */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.app-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: #111827;
}

.app-header__subtitle {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #6b7280;
}

/* WIDGET GRID */
.widget {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.75rem;
}

/* Paneles */
.widget-config,
.widget-output {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.widget-config h2,
.widget-output h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #111827;
}

/* FORMULARIO */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.9rem;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  padding: 0.55rem 0.75rem;
  background: #f9fafb;
  color: #111827;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  background: #ffffff;
}

/* Botones */
.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease,
    background 0.15s ease, border-color 0.15s ease;
}

/* Botón principal: degradado azul–verde */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #10b981);
  color: #f9fafb;
  margin-top: 0.5rem;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Botón secundario */
.btn-secondary {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  margin-top: 1rem;
  width: 100%;
  text-align: center;
}

.btn-secondary:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Texto de ayuda */
.helper-text {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* OUTPUT */
.post-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  border: 1px dashed #d1d5db;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 45%),
              radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.08), transparent 45%),
              #f9fafb;
  min-height: 150px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-card.empty {
  color: #9ca3af;
}

.post-card .placeholder {
  color: #9ca3af;
}

/* Loader */
.loader {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #2563eb;
}

/* Utilidad */
.hidden {
  display: none;
}

/* FOOTER */
.app-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Responsivo */
@media (max-width: 900px) {
  .widget {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .app {
    padding: 1.5rem 1rem 2.5rem;
  }

  .app-header h1 {
    font-size: 1.4rem;
  }
}


/* === Fondo suave para sección Portafolio === */
#portfolio {
  background: linear-gradient(180deg, #f4f6fb 0%, #eef1f8 100%);
  padding: 5rem 0;
}

body.dark #portfolio {
  background: linear-gradient(180deg, #141a2e 0%, #0f1324 100%);
}
