/* =========================================================
   LOGIN MODAL + ADD-PRODUCT MODAL — magic link / añadir URL
   ========================================================= */

.tpm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 19, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  animation: tpm-fade-in 0.15s ease;
}
.tpm-modal-overlay.is-open { display: flex; }
@keyframes tpm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tpm-modal {
  width: 100%;
  max-width: 480px;
  background: var(--tpm-surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: tpm-modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes tpm-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.tpm-modal__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--tpm-text-faint);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.tpm-modal__close:hover { background: var(--tpm-surface-alt); color: var(--tpm-text); }
.tpm-modal__close svg { width: 12px; height: 12px; }

.tpm-modal__body { padding: 40px 40px 36px; }

.tpm-modal__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--tpm-blue-soft);
  color: var(--tpm-blue-dark);
  margin: 0 auto 20px;
}
body.dark-mode .tpm-modal__icon-wrap,
.dark-mode .tpm-modal__icon-wrap { color: var(--tpm-blue); }
.tpm-modal__icon-wrap svg { width: 24px; height: 24px; }

.tpm-modal__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--tpm-text);
  margin: 0 0 6px;
  text-align: center;
}
.tpm-modal__sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--tpm-text-muted);
  margin: 0 0 28px;
  text-align: center;
  text-wrap: balance;
}
.tpm-modal__benefits {
  list-style: none;
  margin: 0 0 28px;
  padding: 22px;
  background: var(--tpm-surface-alt);
  border: 1px solid var(--tpm-border);
  border-radius: 8px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.tpm-modal__benefit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tpm-text);
}
.tpm-modal__benefit-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--tpm-blue);
}
.tpm-modal__benefit-icon svg { width: 100%; height: 100%; }
.tpm-modal__benefit strong { font-weight: 600; }

.tpm-modal__form { display: flex; flex-direction: column; gap: 8px; }
.tpm-modal__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tpm-text-muted);
}
.tpm-modal__input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--tpm-text);
  background: var(--tpm-surface);
  border: 1px solid var(--tpm-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.tpm-modal__input:focus {
  border-color: var(--tpm-blue);
  box-shadow: 0 0 0 3px var(--tpm-blue-soft);
}
.tpm-modal__input::placeholder { color: var(--tpm-text-faint); }
.tpm-modal__submit {
  appearance: none;
  border: 0;
  width: 100%;
  height: 48px;
  margin-top: 10px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--tpm-blue);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.12s, transform 0.12s;
}
.tpm-modal__submit:hover { background: var(--tpm-blue-dark); }
.tpm-modal__submit:active { transform: translateY(1px); }
.tpm-modal__submit svg { width: 14px; height: 14px; }
.tpm-modal__footnote {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--tpm-text-faint);
  line-height: 1.5;
}
.tpm-modal__footnote a {
  color: var(--tpm-text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--tpm-border-strong);
}
.tpm-modal__footnote a:hover { color: var(--tpm-text); }
.tpm-modal__success {
  display: none;
  text-align: center;
  padding: 24px 0 8px;
}
.tpm-modal__success svg {
  width: 48px; height: 48px;
  color: var(--tpm-stat-min);
  margin-bottom: 16px;
}
.tpm-modal__success.is-shown { display: block; }
.tpm-modal__success.is-shown + .tpm-modal__form,
.tpm-modal__success.is-shown ~ .tpm-modal__footnote { display: none; }

@media (max-width: 540px) {
  .tpm-modal__body { padding: 36px 24px 28px; }
  .tpm-modal__title { font-size: 19px; }
  .tpm-modal__sub { font-size: 13.5px; }
}

/* Página de confirmación de magic-link.
   No es un modal pero comparte tokens (tarjeta blanca, fondo gris, CTA azul). */
.lc-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 16px;
  background: var(--tpm-bg);
}
.lc-card {
  width: 100%;
  max-width: 480px;
  background: var(--tpm-surface);
  border: 1px solid var(--tpm-border);
  border-radius: var(--tpm-radius);
  padding: 36px 36px 28px;
  box-shadow: 0 2px 6px rgba(15, 35, 60, 0.06), 0 16px 40px rgba(15, 35, 60, 0.08);
}
.lc-card h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 20px;
  color: var(--tpm-text);
}
.lc-card__sub { color: var(--tpm-text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 8px; }
.lc-card__email { font-weight: 600; font-size: 17px; color: var(--tpm-text); margin: 0 0 24px; word-break: break-all; }
.lc-card__cta {
  display: block;
  width: 100%;
  padding: 12px 18px;
  background: var(--tpm-blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.lc-card__cta:hover { background: var(--tpm-blue-dark, #007cb5); }
.lc-card__explain { color: var(--tpm-text-faint); font-size: 13px; line-height: 1.5; margin: 20px 0 0; }
