/* ═══════════════════════════════════════════════
   ValenciApp — Diseño oscuro y elegante
   ═══════════════════════════════════════════════ */
:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --card: #1a1a24;
  --border: #2a2a3a;
  --gold: #d4af37;
  --gold-bright: #f5d76e;
  --violet: #7c3aed;
  --text: #f0f0f5;
  --text-dim: #9a9aab;
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 20px;
  --nav-h: 64px;
  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, sans-serif;
  overscroll-behavior: none;
}

.hidden { display: none !important; }
.gold { color: var(--gold); }

.glass {
  background: rgba(26, 26, 36, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border: none; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.96); }
.btn-block { width: 100%; margin-top: 10px; }
.btn-small { font-size: 13px; padding: 10px 16px; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #b8952e);
  color: #0a0a0f;
  box-shadow: 0 4px 20px rgba(212, 175, 55, .35);
}
.btn-gold:hover { box-shadow: 0 6px 26px rgba(212, 175, 55, .5); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--gold); }
.btn-google { background: #fff; color: #333; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  padding: 8px; border-radius: 10px; transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--gold); background: rgba(212,175,55,.08); }

/* ── Campos ── */
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input[type="range"] { accent-color: var(--gold); padding: 0; }
.file-input { font-size: 13px; }
.form-status { font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-dim); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ═══════════ AUTH ═══════════ */
.screen { position: fixed; inset: 0; display: none; overflow-y: auto; }
.screen.active { display: flex; align-items: center; justify-content: center; }

.auth-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(124,58,237,.25), transparent),
    radial-gradient(ellipse 60% 40% at 90% 90%, rgba(212,175,55,.15), transparent),
    var(--bg);
}
.auth-card {
  width: min(420px, 92vw); padding: 36px 28px; border-radius: 24px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: fadeUp .5s ease;
}
.logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.logo-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), var(--violet));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 20px rgba(212,175,55,.4);
}
.logo h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.auth-tagline { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }

.auth-tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 10px; border: none; border-radius: 9px; background: transparent;
  color: var(--text-dim); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all .2s;
}
.auth-tab.active { background: linear-gradient(135deg, var(--gold), #b8952e); color: #0a0a0f; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ═══════════ HEADER ═══════════ */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.app-header {
  height: var(--header-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 20;
  border-left: none; border-right: none; border-top: none;
}
.header-logo { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.header-actions { display: flex; gap: 4px; }

.active-filters {
  display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.active-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(212,175,55,.12); color: var(--gold); border: 1px solid rgba(212,175,55,.3);
}

/* ═══════════ TAB SCREENS ═══════════ */
.tab-screen {
  flex: 1; display: none; flex-direction: column; overflow-y: auto;
  padding-bottom: calc(var(--nav-h) + 100px); position: relative;
}
.tab-screen.active { display: flex; }
.section-title { padding: 18px 20px 10px; font-size: 22px; font-weight: 700; }

/* ═══════════ DECK DE TARJETAS ═══════════ */
#screen-swipe { overflow: hidden; }
.deck {
  flex: 1; position: relative; margin: 8px 16px 0;
  perspective: 1000px;
}
.swipe-card {
  position: absolute; inset: 0;
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; will-change: transform;
  transition: transform .35s cubic-bezier(.22,.9,.3,1.2), opacity .3s;
}
.swipe-card.dragging { transition: none; cursor: grabbing; }

.card-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
.card-gradient {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(5,5,10,.95) 0%, rgba(5,5,10,.55) 32%, transparent 60%);
}
.card-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; pointer-events: none; }
.card-name { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-verified {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--green);
  background: rgba(34,197,94,.14); border: 1px solid rgba(34,197,94,.35);
  padding: 3px 9px; border-radius: 999px;
}
.badge-cat {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; margin-top: 6px;
}
.stars-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }
.stars { letter-spacing: 2px; font-size: 17px; }
.star-full  { color: var(--gold-bright); text-shadow: 0 0 8px rgba(245,215,110,.6); }
.star-empty { color: #4a4a58; }
.rating-num { color: var(--gold); font-weight: 600; }
.rating-count { color: var(--text-dim); font-size: 12px; }
.card-meta {
  display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-dim);
}
.card-meta b { color: var(--text); font-weight: 600; }
.card-price { color: var(--gold) !important; font-weight: 700 !important; font-size: 15px !important; }
.card-desc {
  margin-top: 8px; font-size: 13px; color: #cfcfdd; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Sellos INTERESADO / NO */
.stamp {
  position: absolute; top: 26px; padding: 6px 18px;
  font-size: 26px; font-weight: 800; letter-spacing: 2px;
  border: 4px solid; border-radius: 10px; opacity: 0;
  pointer-events: none; z-index: 5;
}
.stamp-like {
  left: 18px; color: var(--green); border-color: var(--green);
  transform: rotate(-14deg);
  background: rgba(34,197,94,.08); text-shadow: 0 0 14px rgba(34,197,94,.5);
}
.stamp-nope {
  right: 18px; color: var(--red); border-color: var(--red);
  transform: rotate(14deg);
  background: rgba(239,68,68,.08); text-shadow: 0 0 14px rgba(239,68,68,.5);
}
.stamp-super {
  left: 50%; top: 44%; transform: translateX(-50%) rotate(-6deg);
  color: var(--blue); border-color: var(--blue);
  background: rgba(59,130,246,.08); text-shadow: 0 0 14px rgba(59,130,246,.5);
  font-size: 22px;
}

.deck-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 30px; color: var(--text-dim);
}
.empty-icon { font-size: 52px; }
.deck-empty h3 { color: var(--text); font-size: 19px; }

/* ═══════════ BOTONES DE ACCIÓN ═══════════ */
.action-buttons {
  position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + 18px);
  display: flex; justify-content: center; gap: 20px; z-index: 10;
  pointer-events: none;
}
.action-btn {
  pointer-events: auto;
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,26,36,.9); backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  transition: transform .18s, box-shadow .18s;
}
.action-btn:hover { transform: scale(1.12); }
.action-btn:active { transform: scale(.94); }
.btn-nope { color: var(--red); border: 2px solid rgba(239,68,68,.5); }
.btn-nope:hover { box-shadow: 0 8px 28px rgba(239,68,68,.35); }
.btn-like { color: var(--green); border: 2px solid rgba(34,197,94,.5); width: 70px; height: 70px; }
.btn-like:hover { box-shadow: 0 8px 28px rgba(34,197,94,.35); }
.btn-super { color: var(--blue); border: 2px solid rgba(59,130,246,.5); width: 54px; height: 54px; align-self: center; }
.btn-super:hover { box-shadow: 0 8px 28px rgba(59,130,246,.35); }

/* ═══════════ MATCHES ═══════════ */
.matches-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 16px 20px; }
.match-card {
  border-radius: var(--radius); overflow: hidden; position: relative;
  background: var(--card); border: 1px solid var(--border);
  animation: fadeUp .35s ease;
}
.match-card img { width: 100%; aspect-ratio: 3/3.4; object-fit: cover; display: block; }
.match-card-info {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
  background: linear-gradient(to top, rgba(5,5,10,.95), transparent);
}
.match-card-info h4 { font-size: 15px; font-weight: 600; }
.match-card-info .stars { font-size: 13px; letter-spacing: 1px; }
.match-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.match-card-actions button {
  flex: 1; padding: 8px 4px; border-radius: 9px; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 600; transition: opacity .2s;
}
.match-card-actions button:active { opacity: .7; }
.mc-contact { background: rgba(212,175,55,.9); color: #0a0a0f; }
.mc-review { background: rgba(124,58,237,.35); color: #d8c8ff; border: 1px solid rgba(124,58,237,.5) !important; }
.mc-reviewed { background: rgba(34,197,94,.18); color: var(--green); pointer-events: none; }

/* ═══════════ PERFIL / PRO ═══════════ */
.profile-card {
  margin: 8px 16px 20px; padding: 24px 20px; border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0,0,0,.4);
}
.profile-photo-wrap { position: relative; width: 108px; margin: 0 auto 20px; }
.profile-photo-wrap img {
  width: 108px; height: 108px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--gold); box-shadow: 0 6px 24px rgba(212,175,55,.3);
}
.photo-edit {
  position: absolute; bottom: 2px; right: 2px;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), #b8952e); color: #0a0a0f;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; transition: all .2s;
}
.chip.selected { background: rgba(212,175,55,.15); border-color: var(--gold); color: var(--gold); }

/* ═══════════ NAV INFERIOR ═══════════ */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0; height: var(--nav-h);
  display: flex; z-index: 15;
  border-left: none; border-right: none; border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; border: none; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-dim); font-family: inherit; font-size: 11px; font-weight: 500;
  transition: color .2s;
}
.nav-btn.active { color: var(--gold); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(212,175,55,.5)); }
.badge {
  position: absolute; top: 6px; right: calc(50% - 24px);
  min-width: 18px; height: 18px; border-radius: 999px; padding: 0 5px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ═══════════ MODALES ═══════════ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,5,10,.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .25s ease;
}
.modal-content {
  position: relative; width: min(400px, 100%); max-height: 88vh; overflow-y: auto;
  border-radius: 24px; padding: 28px 24px; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  animation: popIn .3s cubic-bezier(.34,1.4,.64,1);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--text); border-color: var(--gold); }
.modal-title { font-size: 19px; margin-bottom: 18px; }

/* Modal MATCH */
.match-modal { overflow: visible; }
#confetti-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.match-title {
  font-size: 32px; font-weight: 800; font-style: italic;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: matchPulse 1.2s ease infinite alternate;
}
.match-sub { color: var(--text-dim); margin: 4px 0 16px; font-size: 14px; }
.match-photo {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--gold); box-shadow: 0 0 34px rgba(212,175,55,.55);
}
.match-modal h3, .modal-content > h3 { margin-top: 12px; font-size: 20px; }
.match-contact { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 6px; }
.contact-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 14px; text-decoration: none;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 15px; transition: all .2s;
}
.contact-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.contact-btn.whatsapp { background: rgba(37,211,102,.12); border-color: rgba(37,211,102,.4); }
.contact-btn.whatsapp:hover { background: rgba(37,211,102,.22); }
.contact-desc { color: var(--text-dim); font-size: 13px; margin-top: 10px; line-height: 1.5; }

/* Valoración: selector de estrellas */
.rating-selector, .review-stars { display: flex; justify-content: center; gap: 8px; margin: 8px 0 14px; }
.rate-star {
  font-size: 34px; color: #4a4a58; cursor: pointer; background: none; border: none;
  transition: transform .15s, color .15s; line-height: 1;
}
.rate-star:hover { transform: scale(1.2); }
.rate-star.lit { color: var(--gold-bright); text-shadow: 0 0 12px rgba(245,215,110,.7); }
.rating-selector .rate-star { font-size: 27px; }

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 24px); left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 200;
  animation: toastIn .3s ease; max-width: 90vw; text-align: center;
}

/* ═══════════ ANIMACIONES ═══════════ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes matchPulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Skeleton de carga */
.skeleton {
  position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 40%, #22222e 50%, var(--card) 60%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════ RESPONSIVE ═══════════ */
@media (min-width: 560px) {
  .deck { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
  .matches-list { grid-template-columns: repeat(3, 1fr); max-width: 720px; margin: 0 auto; width: 100%; }
  .profile-card { max-width: 480px; margin-left: auto; margin-right: auto; width: calc(100% - 32px); }
  .section-title { max-width: 720px; margin: 0 auto; width: 100%; }
}
@media (max-height: 640px) {
  .action-btn { width: 54px; height: 54px; }
  .btn-like { width: 60px; height: 60px; }
  .card-name { font-size: 22px; }
}
