/* ============================================================
   proposal-app · style.css
   Estructura: variables → base → fondo/efectos → tarjetas →
   botones → pantallas → modal → utilidades → responsive
   ============================================================ */

:root {
  --accent: #ff4d6d;
  --accent-2: #ff8fa3;
  --accent-dark: #c9184a;
  --accent-soft: rgba(255, 77, 109, 0.35);
  --text: #fff;
  --text-dim: rgba(255, 255, 255, 0.85);
  --glass: rgba(255, 255, 255, 0.10);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 14px 50px rgba(20, 4, 24, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 22px;
  --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, #2b0f3a 0%, #5c1a45 38%, #a0325f 68%, #d6497a 100%);
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
  inset: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  touch-action: manipulation;
}

input,
textarea {
  font-family: inherit;
  color: var(--text);
}

/* ================= FONDO / EFECTOS ================= */

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 18% 12%, rgba(255, 143, 163, 0.28), transparent 70%),
    radial-gradient(42% 36% at 84% 16%, rgba(255, 204, 0, 0.16), transparent 70%),
    radial-gradient(50% 42% at 50% 104%, rgba(200, 77, 150, 0.34), transparent 72%);
  animation: auroraDrift 16s ease-in-out infinite alternate;
}

@keyframes auroraDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2%, 1%, 0) scale(1.08); }
}

/* ================= PANTALLAS ================= */

.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0s linear 0.55s;
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.55s ease;
}

.card {
  width: min(100%, 440px);
  padding: clamp(22px, 6vw, 40px) clamp(18px, 5vw, 36px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  max-height: 100%;
}

.card::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 60%;
  background: radial-gradient(60% 100% at 50% 0%, rgba(255, 255, 255, 0.18), transparent 75%);
  pointer-events: none;
}

.card-in {
  animation: cardIn 0.65s var(--ease) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(34px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.icon-bounce {
  font-size: clamp(42px, 12vw, 64px);
  margin-bottom: 14px;
  animation: bounceIn 0.9s var(--ease) both;
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.2); }
  55%  { transform: scale(1.18); }
  75%  { transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}

h1 {
  font-size: clamp(1.5rem, 6.4vw, 2.4rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 18px rgba(255, 77, 109, 0.45);
}

.sub {
  margin: 14px auto 22px;
  font-size: clamp(0.95rem, 3.8vw, 1.1rem);
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 32ch;
}

.msg {
  margin: 16px auto;
  font-size: clamp(1rem, 4.2vw, 1.2rem);
  line-height: 1.6;
  color: var(--text);
  max-width: 36ch;
  white-space: pre-line;
}

.msg-from {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--accent-2);
  font-style: italic;
}

.msg-date {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.caption {
  margin-top: 16px;
  min-height: 1.4em;
  font-size: clamp(0.95rem, 3.8vw, 1.08rem);
  font-weight: 700;
  color: #ffe066;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.caption.pop {
  animation: popIn 0.4s var(--ease) both;
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.55); }
  100% { opacity: 1; transform: scale(1); }
}

/* ================= BOTONES ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 999px;
  transition: transform 0.18s var(--ease), box-shadow 0.25s ease, background 0.25s ease;
  will-change: transform;
}

.btn:active {
  transform: scale(0.95);
}

.btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 26px var(--accent-soft), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.primary:hover {
  box-shadow: 0 10px 34px var(--accent-soft), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.ghost {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.92rem;
  min-height: 46px;
  padding: 10px 22px;
}

.actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* Botón SÍ */
.yes {
  font-size: clamp(1.2rem, 6vw, 1.55rem);
  padding: 18px 44px;
  background: linear-gradient(135deg, #ff6b8b 0%, var(--accent) 45%, var(--accent-dark) 100%);
  box-shadow: 0 10px 34px var(--accent-soft), 0 6px 18px rgba(0, 0, 0, 0.3);
  animation: heartbeat 1.6s ease-in-out infinite;
  z-index: 2;
}

.yes:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 44px var(--accent-soft), 0 6px 18px rgba(0, 0, 0, 0.32);
}

.yes.big {
  --hb: 1.15;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(var(--hb, 1)); }
  14%      { transform: scale(calc(var(--hb, 1) * 1.07)); }
  28%      { transform: scale(var(--hb, 1)); }
  42%      { transform: scale(calc(var(--hb, 1) * 1.07)); }
  70%      { transform: scale(var(--hb, 1)); }
}

/* Botón NO */
.no {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  min-width: 128px;
  transition: transform 0.22s ease, background 0.25s ease, opacity 0.25s ease;
  will-change: transform, left, top;
}

.no.land {
  animation: noLand 0.45s var(--ease);
}

@keyframes noLand {
  0%   { transform: scale(0.6) rotate(-8deg); }
  60%  { transform: scale(1.08) rotate(3deg); }
  100% { transform: scale(var(--no-scale, 1)) rotate(var(--no-rot, 0deg)); }
}

.heart-pulse {
  font-size: clamp(40px, 12vw, 62px);
  margin-bottom: 12px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 5vw, 24px);
  margin-top: 24px;
  min-height: 90px;
  position: relative;
}

/* ================= FOTOS ================= */

.photos {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.photos.row {
  margin-bottom: 8px;
}

.photos.grid {
  margin-top: 18px;
}

.photos .thumb {
  width: 150px;
  height: 150px;
  flex: 0 0 auto;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  animation: popIn 0.5s var(--ease) both;
  background: rgba(255, 255, 255, 0.12);
}

.photos.grid .thumb {
  width: 176px;
  height: 176px;
  border-radius: 22px;
}

.photos.small .thumb {
  width: 80px;
  height: 80px;
  border-radius: 14px;
}

.photos .thumb.empty {
  display: none;
}

.del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(20, 4, 24, 0.88);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* ================= TOP BAR ================= */

.topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 5;
  display: flex;
  gap: 8px;
}

.chip {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);
}

.chip:active {
  transform: scale(0.93);
}

.chip.playing {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* ================= MENSAJE DEL BOTÓN NO ================= */

.no-msg {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  transform: translateX(-50%) scale(0);
  z-index: 6;
  background: rgba(20, 4, 24, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffe066;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
  max-width: 92vw;
  text-overflow: ellipsis;
  overflow: hidden;
  transition: transform 0.25s var(--ease);
}

.no-msg.show {
  transform: translateX(-50%) scale(1);
}

/* ================= MODAL ================= */

.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: none;
  background: rgba(15, 3, 20, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal:not([open]) {
  display: none;
}

.modal[open] {
  animation: fadeIn 0.3s ease both;
}

.modal::backdrop {
  background: transparent;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(165deg, #3d1230, #24102e);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-radius: 24px;
  padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: sheetUp 0.4s var(--ease) both;
}

@keyframes sheetUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box h2 {
  font-size: 1.35rem;
  text-align: center;
}

.modal-box label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: left;
}

.modal-box input[type="text"],
.modal-box input[type="date"],
.modal-box textarea,
.modal-box input[type="color"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 1rem;
  color: var(--text);
}

.modal-box input[type="color"] {
  height: 46px;
  padding: 4px;
}

.modal-box textarea {
  resize: vertical;
  min-height: 70px;
}

.modal-box input[type="file"] {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dim);
}

.field-label small {
  font-weight: 400;
  opacity: 0.8;
}

.hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--accent-2);
}

/* ================= TOAST ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translateX(-50%) translateY(24px);
  z-index: 12;
  background: rgba(20, 4, 24, 0.9);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
  max-width: 92vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= CELABRACIÓN ================= */

.celebrate h1 {
  font-size: clamp(1.4rem, 6vw, 2.2rem);
}

/* ================= ACCESIBILIDAD / REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

@media (max-height: 700px) {
  .screen {
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .card {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .icon-bounce {
    margin-bottom: 6px;
  }

  .sub {
    margin: 10px auto 14px;
  }
}

@media (max-width: 380px) {
  .yes {
    padding: 16px 34px;
  }

  .no {
    min-width: 110px;
  }

  .photos .thumb {
    width: 132px;
    height: 132px;
  }

  .photos.grid .thumb {
    width: 158px;
    height: 158px;
  }
}