:root {
  --ink: #2B0F2E;
  --ink-soft: #5A3A5E;
  --bg: #FBF4CD;
  --card: #FFFDF5;
  --red: #DE412F;
  --fuchsia: #C81558;
  --fuchsia-soft: #FFE3F3;
  --orange: #F483FB;
  --accent: #C81558;
  --accent-soft: #FFE3F3;
  --grad: #C81558;
  --line: #F0D5E8;
  --radius: 18px;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.brand {
  flex: none;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand .lab {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  margin-left: 14px;
}

.progress-bar {
  flex: 1;
  min-width: 24px;
  height: 8px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad);
  width: 0%;
  transition: width 0.3s ease;
}

#progressLabel {
  font-size: 0.8rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.hidden { display: none !important; }

.chapter-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.chapter-sub {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.question-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.question-prompt {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 0.98rem;
}

.help-text {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: -6px;
  margin-bottom: 10px;
}

.chip-group, .options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--accent); }
.chip.selected {
  background: var(--grad);
  border-color: var(--fuchsia);
  color: #fff;
}

.scale-row {
  display: flex;
  gap: 8px;
}

.scale-btn {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  font-weight: 600;
}

.scale-btn.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}

textarea { min-height: 80px; resize: vertical; }

.matrix-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.matrix-row:last-child { border-bottom: none; }
.matrix-label { font-size: 0.88rem; }

.scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.section-note {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.photo-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

button.primary, button.secondary {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

button.primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 21, 88, 0.28);
}
button.primary:hover { filter: brightness(0.94); }
button.secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
button.secondary:hover { border-color: var(--accent); }

.chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.chapter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.chapter-dot.done { background: var(--grad); }
.chapter-dot.current { background: var(--ink); }

.match-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.match-score {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.3;
}

.result-subheading {
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 16px;
  margin-bottom: 6px;
  color: var(--ink);
}

.reason-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--ink);
}

.reason-list li {
  margin-bottom: 4px;
}

.difference-text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: #FFE3F3;
  border-radius: 8px;
  padding: 10px 12px;
}

.essence-qa {
  margin-bottom: 12px;
}

.essence-question {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

.essence-answer {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.4;
}

.dim-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--ink-soft);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 3px var(--fuchsia-soft, #fbe1ee);
}

.legal-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.legal-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--ink-soft); line-height: 1.45; cursor: pointer; }
.legal-check input { width: auto; margin-top: 3px; accent-color: var(--fuchsia); flex-shrink: 0; }
.legal-check a { color: var(--fuchsia); font-weight: 600; }

.code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-weight: 700; }
.code-links { display: flex; justify-content: space-between; margin-top: 12px; }
.link-button { background: none; border: none; padding: 4px 0; color: var(--fuchsia); font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.link-button:disabled { color: var(--ink-soft); cursor: default; font-weight: 500; }

/* Tu perfil LiveLov */
.self-kicker { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.self-type { font-size: 2.2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.15; }
.self-tagline { color: var(--ink); margin: 4px 0 16px; font-size: 1.05rem; }
.axis-block { margin: 14px 0 6px; }
.axis-bar { position: relative; height: 8px; border-radius: 999px; background: #F0D5E8; margin-top: 6px; }
.axis-dot { position: absolute; top: -4px; width: 16px; height: 16px; border-radius: 50%; background: var(--grad); transform: translateX(-50%); box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.axis-ends { display: flex; justify-content: space-between; font-size: 0.75rem; color: #7b6372; margin-top: 4px; }
.axis-text { margin-top: 6px; line-height: 1.45; }
.axis-rel { color: #5A3A5E; font-size: 0.95rem; }
.self-profile .help-text { margin-top: 16px; }

/* Portal "Mi perfil" */
.active-banner { background: #fff; border: 1px solid #f0d9c8; border-left: 5px solid var(--fuchsia); position: relative; border-radius: 14px; padding: 14px 16px; margin: 8px 0 16px; }
.active-banner-title { font-weight: 800; color: var(--fuchsia); font-size: 1.05rem; }
.active-banner-text { margin-top: 4px; line-height: 1.45; color: var(--ink); }
.portal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.portal-tab { border: 1px solid #FFB8E2; background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; font-size: 0.95rem; }
.portal-tab.active { background: var(--grad); color: #fff; border-color: transparent; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.logout-wrap { margin-top: 28px; }
.logout-wrap .help-text { margin-top: 10px; }

/* Language switch (ES | EN) in the top bar */
.lang-switch { display: flex; gap: 4px; margin-left: 12px; flex-shrink: 0; }
.lang-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.lang-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

.lovi-hero { display: flex; justify-content: center; margin: 4px 0 8px; }
.banner-lovi { float: right; margin: -6px 0 4px 10px; }
.empty-state .lovi-hero { margin-bottom: 12px; }
.match-lovi { float: right; margin: -4px 0 0 8px; }
.self-profile .arch-card { margin: 8px 0 18px; }

/* ===== Bold look: full-bleed color screens, big Fredoka titles, pill controls ===== */
:root { --slate: #566B9B; --ink-soft: #5A3A5E; }
body { background: var(--bg); }
body:has(.login-marker) { background: #DE412F; }
body:has(.chapter-nav) { background: var(--slate); }

.chapter-title { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 2.3rem; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 8px; }
.chapter-sub { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
body:has(.login-marker) .chapter-title, body:has(.chapter-nav) .chapter-title { color: #FFFDF5; }
body:has(.login-marker) .chapter-sub, body:has(.chapter-nav) .chapter-sub { color: #FFFDF5; font-size: 1.1rem; }
.lovi-hero { margin-top: 4px; }

.question-card, .match-card { border: none; border-radius: 28px; padding: 22px; box-shadow: 0 10px 28px -18px rgba(43, 15, 46, 0.45); }
.question-prompt { font-weight: 800; font-size: 1.05rem; }
.chip { border: 2px solid var(--line); background: #fff; padding: 10px 18px; font-weight: 700; font-size: 0.95rem; }
.chip:hover { border-color: var(--ink); }
.chip.selected { background: #F483FB; border-color: #F483FB; color: var(--ink); }
.scale-btn { border: 2px solid var(--line); border-radius: 16px; font-weight: 800; }
.scale-btn.selected { background: #F483FB; border-color: #F483FB; color: var(--ink); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
input:focus, textarea:focus, select:focus { border-color: var(--fuchsia); outline: none; }

button.primary, button.secondary { border-radius: 999px; padding: 15px 30px; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 1.12rem; }
button.primary { background: var(--fuchsia); color: #FFFDF5; box-shadow: none; }
button.secondary { background: #FFFDF5; border: none; color: var(--ink); }
body:has(.login-marker) button.primary, body:has(.chapter-nav) button.primary { background: var(--ink); }

.chapter-nav { gap: 5px; flex-wrap: nowrap; }
.chapter-dot { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 253, 245, 0.35); }
.chapter-dot.done { background: #F483FB; }
.chapter-dot.current { background: #FFFDF5; }

.section-note { background: #FFE3F3; color: var(--ink); border-radius: 16px; }
.match-score { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 700; font-size: 1.55rem; background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--fuchsia); padding-right: 64px; }
.portal-tab { border: 2px solid var(--line); font-weight: 800; padding: 10px 18px; }
.portal-tab.active { background: var(--fuchsia); border-color: var(--fuchsia); color: #fff; }
.active-banner { border: none; border-left: none; background: #FFB8E2; border-radius: 28px; padding: 18px 20px; }
.active-banner-title { font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 1.3rem; color: var(--ink); }
.self-profile { padding: 14px; }
.arch-card { border-radius: 24px; }
.axis-bar { height: 12px; background: #FFE3F3; }
.lang-btn { border: 2px solid var(--line); font-weight: 800; }
.axis-dot { width: 24px; height: 24px; top: -6px; background: var(--ink); }

.match-interests{display:flex;flex-wrap:wrap;gap:6px;margin:10px 0 4px}
.match-interests .chip{cursor:default;font-size:13px;padding:5px 12px}

.match-name{font-family:'Fredoka',sans-serif;font-weight:700;font-size:26px;line-height:1.1;margin:6px 0 2px}

.chip-group-title{flex-basis:100%;font-family:'Fredoka',sans-serif;font-weight:700;font-size:15px;color:var(--crimson,#C81558);margin:10px 0 0}
.pick-counter{font-weight:800;margin-bottom:6px}

/* Profile screen */
.profile-card { background: #FFFDF5; border-radius: 32px; padding: 26px 22px 22px; box-shadow: 0 10px 28px -18px rgba(43, 15, 46, 0.45); }
.pf-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pf-avatar { width: 132px; height: 132px; border-radius: 50%; overflow: hidden; background: #FFB8E2; border: 5px solid #F483FB; display: flex; align-items: center; justify-content: center; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-beta { margin-top: -16px; position: relative; background: #C81558; color: #FFFDF5; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px; padding: 4px 18px; border-radius: 999px; border: 3px solid #FFFDF5; }
.pf-name { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 2rem; line-height: 1.05; letter-spacing: -0.02em; margin-top: 8px; }
.pf-email { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.pf-edit { margin-top: 14px; background: #C81558; color: #FFFDF5; border: none; border-radius: 999px; padding: 11px 28px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1rem; cursor: pointer; }
.pf-edit:disabled { opacity: 0.6; }
.pf-cancel { background: #FFB8E2; color: var(--ink); border: none; border-radius: 999px; padding: 11px 24px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1rem; cursor: pointer; }
.pf-rows { margin-top: 22px; display: grid; grid-template-columns: 1fr; gap: 12px; }
.pf-row { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1rem; }
.pf-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; background: #FFB8E2; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.pf-row:nth-child(2n) .pf-icon { background: #F483FB; }
.pf-row:nth-child(3n) .pf-icon { background: #FBF4CD; }
.pf-section { font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.15rem; color: #C81558; margin: 22px 0 8px; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { background: #FFB8E2; color: var(--ink); border-radius: 999px; padding: 7px 16px; font-weight: 800; font-size: 0.92rem; }
.pf-chip:nth-child(3n+2) { background: #F483FB; }
.pf-chip:nth-child(3n) { background: #FBF4CD; box-shadow: inset 0 0 0 2px #FFB8E2; }
.pf-about { background: #FBF4CD; border-radius: 20px; padding: 14px 16px; font-weight: 700; line-height: 1.45; white-space: pre-wrap; }
.pf-about.empty { color: var(--ink-soft); }
.pf-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.pf-photo { position: relative; padding: 0; border: 3px solid transparent; border-radius: 16px; overflow: hidden; background: none; aspect-ratio: 1; cursor: pointer; }
.pf-photo.main { border-color: #C81558; }
.pf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-photo-tag { position: absolute; left: 0; right: 0; bottom: 0; background: #C81558; color: #FFFDF5; font-size: 11px; font-weight: 800; padding: 2px 0; text-align: center; }
.pf-foot { margin-top: 22px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); text-align: center; }
.pf-field { margin-top: 16px; }
.pf-label { display: block; font-weight: 800; margin-bottom: 6px; }
.pf-field input[type=text], .pf-field input[type=date], .pf-field select, .pf-field textarea { width: 100%; border: 2px solid var(--line); border-radius: 16px; padding: 11px 14px; font: inherit; font-weight: 700; background: #fff; color: var(--ink); }
.pf-field textarea { min-height: 110px; resize: vertical; }
.pf-bar { display: flex; gap: 10px; margin-top: 22px; }
.pf-bar .pf-edit { margin-top: 0; }
.photo-main-tag { position: absolute; left: 0; right: 0; bottom: 0; background: #C81558; color: #FFFDF5; font-size: 11px; font-weight: 800; padding: 2px 0; text-align: center; }
.match-about { font-weight: 700; line-height: 1.4; margin: 8px 0; }
@media (min-width: 760px) { .pf-rows { grid-template-columns: 1fr 1fr; } }

.pf-photo-cell { position: relative; }
.pf-photo-cell .pf-photo { width: 100%; }
.pf-photo-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: #2B0F2E; color: #FFFDF5; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.pf-photo-add { aspect-ratio: 1; border-radius: 16px; border: 3px dashed #F483FB; background: #FFE3F3; color: #C81558; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-weight: 800; }
.pf-photo-add span { font-family: 'Fredoka', sans-serif; font-size: 28px; line-height: 1; }
.pf-photo-msg { min-height: 1em; font-weight: 800; }

/* Matrix questions on phones: label on top, answer buttons fill the full width in equal columns */
.matrix-row { grid-template-columns: 1fr; gap: 8px; }
.matrix-label { font-weight: 800; font-size: 0.98rem; }
.scale-row.matrix-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: 100%; }
.scale-row.matrix-scale .scale-btn { min-width: 0; padding: 10px 2px; font-size: 0.95rem; text-align: center; display: flex; align-items: center; justify-content: center; }
.scale-row.matrix-scale .scale-btn-text { font-size: 0.7rem; line-height: 1.1; padding: 9px 1px; overflow-wrap: anywhere; hyphens: auto; }
.scale-row.matrix-scale:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.question-card { overflow: hidden; }
html, body { overflow-x: hidden; }

/* Header on small phones: keep the logo, progress and ES/EN buttons from overlapping */
#progressLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .topbar { padding: 12px 14px; }
  .brand { font-size: 1.4rem; }
  .progress-wrap { margin-left: 8px; gap: 6px; }
  .progress-bar { min-width: 16px; }
  #progressLabel { font-size: 0.7rem; }
  .topbar .lang-toggle button, .topbar [class*="lang"] button { padding: 6px 12px; }
}
@media (max-width: 420px) {
  .question-card { padding: 20px 14px; }
  .scale-row.matrix-scale { gap: 4px; }
  .scale-row.matrix-scale .scale-btn-text { font-size: 0.66rem; overflow-wrap: normal; hyphens: none; padding: 9px 0; }
}

.missing-banner { background: #FFE3E0; color: #9B1B0F; border: 2px solid var(--red-orange, #DE412F); border-radius: 16px; padding: 12px 16px; margin: 16px 0; font-weight: 700; }
.question-card.q-missing { outline: 3px solid #DE412F; outline-offset: 2px; }
