/* Componentes: botones, tarjetas, timeline, contactos, plan y avisos */

/* ---------- Botones ---------- */

.btn {
  --btn-bg: var(--c-amber);
  --btn-fg: #1a1204;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.45rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-stretch: 90%;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 99px;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur) ease,
    background var(--dur) ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -14px rgba(255, 176, 32, 0.75);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-text);
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
}

.btn--ghost:hover {
  --btn-fg: var(--c-amber);
  box-shadow: inset 0 0 0 1px var(--c-amber);
}

.btn--sm {
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
}

/* ---------- Superficies ---------- */

.card {
  background: linear-gradient(180deg, var(--c-surface), var(--c-base));
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
}

.card--hazard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--hazard);
  opacity: 0.85;
}

/* ---------- Timeline antes / durante / después ---------- */

.phase {
  border-left: 2px solid var(--c-line);
  padding-left: var(--space-6);
  display: grid;
  gap: var(--space-4);
  position: relative;
}

.phase::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-amber);
  box-shadow: 0 0 0 5px rgba(255, 176, 32, 0.14);
}

.phase--now::before {
  background: var(--c-rescue);
  box-shadow: 0 0 0 5px rgba(255, 95, 31, 0.16);
}

.phase--after::before {
  background: var(--c-safe);
  box-shadow: 0 0 0 5px var(--c-safe-glow);
}

.phase__title {
  font-size: var(--text-xl);
  font-stretch: 86%;
  text-transform: uppercase;
}

.phase__list {
  list-style: none;
  display: grid;
  gap: var(--space-3);
  color: var(--c-text-soft);
}

.phase__list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.phase__list li::before {
  content: '';
  width: 8px;
  height: 8px;
  margin-top: 0.55em;
  background: currentColor;
  opacity: 0.45;
  transform: rotate(45deg);
}

.phase__list strong {
  color: var(--c-text);
  font-weight: 600;
}

/* ---------- Aviso destacado ---------- */

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-6);
  border-radius: var(--radius);
  background: rgba(255, 77, 77, 0.07);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: var(--c-text-soft);
  font-size: var(--text-sm);
}

.notice__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--c-alert);
  color: #2a0505;
  font-weight: 800;
  font-family: var(--font-display);
}

.notice strong {
  color: var(--c-text);
}

.notice--amber {
  background: var(--c-amber-glow);
  border-color: rgba(255, 176, 32, 0.35);
}

.notice--amber .notice__icon {
  background: var(--c-amber);
  color: #1a1204;
}

/* Informativo, no de alerta: el rojo se reserva para el riesgo real. */
.notice--info {
  background: var(--c-surface);
  border-color: var(--c-line-strong);
}

.notice--info .notice__icon {
  background: var(--c-surface-2);
  border: 1px solid var(--c-line-strong);
  color: var(--c-text-soft);
}

/* ---------- Líneas de atención ---------- */

.contact {
  display: grid;
  gap: 0.35rem;
  padding: var(--space-6);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out-expo), border-color var(--dur) ease,
    background var(--dur) ease;
}

.contact:hover {
  transform: translateY(-4px);
  border-color: var(--c-amber);
  background: var(--c-surface-2);
}

.contact__num {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 900;
  font-stretch: 80%;
  line-height: 1;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur) ease;
}

.contact:hover .contact__num {
  color: var(--c-amber);
}

.contact__name {
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--c-amber);
}

.contact__detail {
  font-size: var(--text-sm);
  color: var(--c-text-soft);
}

.contact--priority {
  background: linear-gradient(150deg, rgba(255, 176, 32, 0.16), var(--c-surface) 62%);
  border-color: rgba(255, 176, 32, 0.42);
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .contact--priority {
    grid-column: span 2;
  }

  .contact--priority .contact__num {
    font-size: clamp(3rem, 2rem + 4vw, 4.6rem);
    color: var(--c-amber);
  }
}

/* ---------- Plan familiar ---------- */

.plan {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field__label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-mute);
  font-weight: 600;
}

.field input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--c-void);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur) ease, background var(--dur) ease;
}

.field input::placeholder {
  color: var(--c-text-mute);
}

.field input:hover {
  border-color: var(--c-line-strong);
}

.field input:focus {
  outline: none;
  border-color: var(--c-amber);
  background: #0b0d10;
}

.plan__saved {
  font-size: var(--text-xs);
  color: var(--c-safe);
  opacity: 0;
  transition: opacity var(--dur) ease;
}

.plan__saved[data-visible='true'] {
  opacity: 1;
}

/* ---------- Aviso flotante ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-8);
  z-index: 90;
  transform: translate(-50%, 180%);
  padding: 0.85rem 1.4rem;
  background: var(--c-safe);
  color: #062516;
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: 99px;
  box-shadow: var(--shadow-lift);
  transition: transform var(--dur) var(--ease-spring);
  pointer-events: none;
}

.toast[data-visible='true'] {
  transform: translate(-50%, 0);
}

/* ---------- Revelado al hacer scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.reveal[data-shown='true'] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Impresión: la lista debe poder llevarse en papel ---------- */

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before,
  body::after,
  .topbar,
  .hero__seismo,
  .btn,
  .toast,
  .drill {
    display: none !important;
  }

  .card,
  .contact,
  .item {
    border: 1px solid #bbb;
    background: #fff;
    color: #000;
    break-inside: avoid;
  }
}
