/* Terrabuxena — landing estática. Mobile-first, responsive. */
:root {
  --green: #14532d;
  --green-soft: #166534;
  --green-glow: rgba(20, 83, 45, 0.18);
  --bg: #f6f7f4;
  --card: #ffffff;
  --text: #1f2937;
  --text-soft: #6b7280;
  --border: #e5e7eb;
  --free: #b45309;       /* ámbar: resalta el "GRATIS" */
  --free-bg: #fef3c7;
  --radius: 16px;
  --maxw: 760px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-soft) 100%);
  color: #fff;
  text-align: center;
  padding: 3.5rem 0 3rem;
}

.hero-mark {
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  margin: 0.75rem auto 0;
  max-width: 36rem;
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  color: rgba(255, 255, 255, 0.9);
}

/* Apps */
main { flex: 1; width: 100%; }

.apps {
  display: grid;
  gap: 1rem;
  margin: -1.75rem auto 0;
  padding-bottom: 2.5rem;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.app-card:hover,
.app-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--green-glow);
  border-color: var(--green-soft);
  outline: none;
}

.app-icon {
  flex: 0 0 auto;
  font-size: 2rem;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  background: #ecfdf3;
  border-radius: 12px;
}

.app-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.app-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green);
}

.app-desc {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin-top: 0.15rem;
}

.app-cta {
  flex: 0 0 auto;
  align-self: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--green-soft);
  white-space: nowrap;
}

/* Aviso "añade tu servicio" (web sencilla totalmente gratis) */
.join { padding-bottom: 2.5rem; }

.join-card {
  position: relative;
  background: var(--card);
  border: 2px dashed var(--green-soft);
  border-radius: var(--radius);
  padding: 1.75rem 1.4rem 1.5rem;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.join-badge {
  display: inline-block;
  background: var(--free-bg);
  color: var(--free);
  border: 1px solid var(--free);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.join-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--green);
}

.join-text {
  margin: 0.5rem auto 1rem;
  max-width: 32rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.join-button {
  display: inline-block;
  background: var(--green-soft);
  color: #fff;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.join-button:hover,
.join-button:focus-visible {
  background: var(--green);
  transform: translateY(-1px);
}

.join-button:disabled { opacity: 0.6; cursor: default; transform: none; }

/* Popup del formulario */
/* display:flex pisaría el atributo hidden (display:none del navegador):
   reafirmarlo con más especificidad. */
.modal-backdrop[hidden] { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.75rem;
  width: 100%;
  max-width: 26rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover, .modal-close:focus-visible { color: var(--text); }

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green);
}

.modal-intro {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.modal form { text-align: left; }

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0.9rem 0 0.3rem;
}

.modal input,
.modal textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  resize: vertical;
}

.modal input:focus,
.modal textarea:focus {
  outline: 2px solid var(--green-soft);
  border-color: var(--green-soft);
}

.modal form .join-button { width: 100%; margin-top: 1.1rem; }

.form-error {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: #b91c1c;
}

.join-success {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green-soft);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 1.5rem 0 2rem;
  text-align: center;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  max-width: 34rem;
  margin: 0 auto;
}

.footer-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.version { font-variant-numeric: tabular-nums; opacity: 0.8; }

/* Toast de autoactualización */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 50;
}

/* En pantallas anchas, las tarjetas conviven cómodas en una sola columna ancha.
   El icono y el CTA se mantienen; en móvil el CTA se baja bajo el texto. */
@media (max-width: 460px) {
  .app-card { flex-wrap: wrap; }
  .app-cta { width: 100%; padding-left: 4.25rem; }
}
