:root {
  --navy: #061636;
  --navy-deep: #020b1f;
  --gold: #d4af37;
  --gold-soft: #f0d78c;
  --cream: #f7f3ea;
  --white: #ffffff;
  --muted: rgba(247, 243, 234, 0.72);
  --danger: #ffb4b4;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Source Sans 3", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 10%, rgba(212, 175, 55, 0.18), transparent 35%),
    radial-gradient(circle at 85% 90%, rgba(80, 130, 220, 0.16), transparent 40%),
    linear-gradient(160deg, var(--navy-deep), var(--navy) 55%, #0a2048);
  background-attachment: fixed;
}

.page {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--gold-soft);
}

.header h1 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--white);
}

.subtitle {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel {
  display: grid;
  gap: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius);
  background: rgba(4, 16, 40, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.preview-wrap {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: #000;
}

.preview {
  display: block;
  width: 100%;
  height: auto;
}

.form {
  display: grid;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem 0.5rem;
}

.form label {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--gold-soft);
}

.form input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #14233f;
  font: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

.btn {
  margin-top: 0.35rem;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1.2rem;
  background: linear-gradient(135deg, #e4c76a, var(--gold) 45%, #b89020);
  color: #1a1404;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.progress {
  display: grid;
  gap: 0.55rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b89020, var(--gold-soft), #b89020);
  background-size: 200% 100%;
  transition: width 0.25s ease;
  animation: shimmer 1.2s linear infinite;
}

.progress-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.status {
  min-height: 1.3em;
  margin: 0;
  font-size: 0.95rem;
  color: var(--gold-soft);
}

.status.error {
  color: var(--danger);
}

.footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0.2rem 0;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (min-width: 820px) {
  .panel {
    grid-template-columns: 1.35fr 0.9fr;
    align-items: center;
    padding: 1.5rem;
  }
}

/* Modal de éxito */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 24, 0.72);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 1.75rem 1.5rem 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(165deg, #0c2348, #061636 70%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: popIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.modal-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0b2a14;
  background: linear-gradient(145deg, #6ee7a0, #25d366);
  box-shadow: 0 0 0 6px rgba(37, 211, 102, 0.18);
}

.modal-card h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--white);
}

.modal-text {
  margin: 0.65rem 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.modal-actions {
  display: grid;
  gap: 0.65rem;
}

.btn-whatsapp {
  background: linear-gradient(135deg, #2fe074, #25d366 55%, #1ebe57);
  color: #053016;
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(247, 243, 234, 0.28);
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  filter: none;
  background: rgba(255, 255, 255, 0.06);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
