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

:root {
  /* Heart/Love color scheme from original design */
  --heart-primary: #cc328c;
  --heart-dark: #a91f6a;
  --heart-light: #e84b9a;
  --accent-gold: #ffa500;
  --bg-light: #fff9fb;
  --bg-white: #ffffff;
  --text-dark: #2d1b2e;
  --text-muted: #6b5b6b;
  --shadow-sm: 0 2px 8px rgba(204, 50, 140, 0.12);
  --shadow-md: 0 8px 24px rgba(204, 50, 140, 0.18);
  --shadow-lg: 0 16px 40px rgba(204, 50, 140, 0.2);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Typography */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
}

p {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--heart-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--heart-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--heart-primary);
  border: 2px solid var(--heart-primary);
}

.btn-secondary:hover {
  background: var(--bg-light);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid #e0d5e0;
}

.btn-ghost:hover {
  background: var(--bg-light);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  padding: 0.75rem 1rem;
  border: 2px solid #e0d5e0;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: var(--bg-white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--heart-primary);
  box-shadow: 0 0 0 3px rgba(204, 50, 140, 0.1);
}

input::placeholder {
  color: #c9b0c9;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: var(--heart-primary);
}

.checkbox-item label {
  margin: 0;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-dark);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.navbar {
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heart-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand::before {
  content: "❤️";
  font-size: 1.75rem;
}

.navbar-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.navbar-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-link:hover {
  color: var(--heart-primary);
}

.navbar-logout {
  color: var(--text-muted);
  font-size: 0.875rem;
  opacity: 0.7;
}

.navbar-logout:hover {
  color: #c0392b;
  opacity: 1;
}

.lang-toggle {
  background: transparent;
  border: 1.5px solid var(--heart-primary);
  color: var(--heart-primary);
  border-radius: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

.lang-toggle:hover {
  background: var(--heart-primary);
  color: white;
}

/* Page switching */
.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* Landing Page - Two Column Layout (from original design) */
.hero {
  background: var(--bg-light);
  padding: 2rem 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  min-height: 70vh;
}

.hero-left {
  text-align: left;
}

.hero-left h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--heart-primary);
}

.hero-left p {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.hero-left .btn {
  margin-right: 1rem;
  margin-bottom: 1rem;
}

.hero-right {
  text-align: center;
  position: relative;
}

.hero-image {
  width: 100%;
  max-width: 400px;
  height: 500px;
  background: linear-gradient(135deg, var(--heart-primary) 0%, var(--heart-light) 100%);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 5rem;
  box-shadow: var(--shadow-lg);
}

/* Register Page */
.auth-container {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2.5rem;
  background: var(--bg-white);
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--heart-primary);
}

.auth-info {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 1.75rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid var(--heart-primary);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--heart-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-tab.active {
  background: var(--heart-primary);
  color: white;
}

.auth-tab:not(.active):hover {
  background: var(--bg-light);
}

/* Gate banner */
.auth-gate {
  background: #fff8e6;
  border: 1.5px solid #f0a500;
  border-radius: 0.5rem;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.5rem;
  color: #7a5200;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

.auth-link {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-link a {
  color: var(--heart-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Discover/Match Page */
.discover-container {
  max-width: 900px;
  margin: 3rem auto;
}

.selector-section {
  background: var(--bg-white);
  border-radius: 1rem;
  padding: 3rem 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.selector-section h2 {
  color: var(--heart-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Two column layout for gender selection */
.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

.option-card-full {
  grid-column: 1 / -1;
}

.option-card {
  padding: 2rem;
  border: 2px solid #e0d5e0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-white);
  text-align: center;
}

.option-card:hover {
  border-color: var(--heart-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.option-card.selected {
  background: var(--heart-primary);
  color: white;
  border-color: var(--heart-primary);
  box-shadow: var(--shadow-lg);
}

.option-card.selected h3 {
  color: white;
}

.option-card.selected p {
  color: rgba(255, 255, 255, 0.9);
}

.option-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.option-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--heart-primary);
}

.option-card.selected h3 {
  color: white;
}

.option-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Age range slider */
.age-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2rem 0;
}

input[type="range"] {
  width: 100%;
  max-width: 300px;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--heart-primary), var(--heart-light));
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--heart-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--heart-primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

#ageDisplay {
  font-weight: 700;
  color: var(--heart-primary);
  font-size: 1.5rem;
  margin-top: 1rem;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.action-buttons .btn {
  flex: 1;
  max-width: 200px;
}

/* Success message */
.success-message {
  display: none;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--heart-primary), var(--heart-light));
  color: white;
  border-radius: 0.5rem;
  text-align: center;
  margin: 2rem 0;
  animation: slideDown 0.3s ease;
  box-shadow: var(--shadow-md);
}

.success-message.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
footer {
  background: var(--text-dark);
  color: #a8a0a8;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
  border-top: 2px solid var(--heart-primary);
}

footer a {
  color: var(--heart-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-left h1 {
    font-size: 2rem;
  }

  .hero-image {
    max-width: 300px;
    height: 400px;
    font-size: 4rem;
  }

  .navbar-nav {
    gap: 1rem;
  }

  .gender-grid {
    grid-template-columns: 1fr;
  }

  .auth-container {
    margin: 1rem;
    padding: 1.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.125rem;
  }

  .hero-left h1 {
    font-size: 1.75rem;
  }

  .hero-image {
    max-width: 250px;
    height: 350px;
    font-size: 3rem;
  }

  .navbar-content {
    flex-direction: column;
    gap: 0.75rem;
  }

  .navbar-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .selector-section {
    padding: 1.5rem 1rem;
  }
}

/* Matches Page */
.matches-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-light);
  padding: 1.5rem 0;
}

.matches-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  width: 100%;
  padding: 0 1.5rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.stat-icon {
  font-size: 1.75rem;
  min-width: 2rem;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin: 0;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heart-primary);
  margin: 0;
}

.matches-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  width: 100%;
}

.profile-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.profile-card:active {
  cursor: grabbing;
}

.card-appear {
  animation: cardSlideIn 0.4s ease;
}

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

@keyframes cardSwipeRight {
  to {
    opacity: 0;
    transform: translateX(500px) rotate(20deg);
  }
}

@keyframes cardSwipeLeft {
  to {
    opacity: 0;
    transform: translateX(-500px) rotate(-20deg);
  }
}

.card-image {
  width: 100%;
  height: 350px;
  background: linear-gradient(135deg, var(--heart-primary) 0%, var(--heart-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-avatar {
  font-size: 6rem;
  animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.card-info {
  padding: 1.5rem;
}

.card-header {
  margin-bottom: 1rem;
}

.card-header h2 {
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
}

.card-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.interests-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.interest-tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--heart-primary);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--heart-primary);
}

.no-more-profiles {
  text-align: center;
  padding: 3rem;
}

.empty-state {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}

.empty-state h2 {
  color: var(--heart-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.action-buttons .btn {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  min-width: 140px;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.matches-footer {
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* Card animation states */
.card-swipe-right {
  animation: cardSwipeRight 0.5s ease forwards;
}

.card-swipe-left {
  animation: cardSwipeLeft 0.5s ease forwards;
}

@media (max-width: 768px) {
  .matches-header {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .stat {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .stat-icon {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .profile-card {
    max-width: 100%;
  }

  .card-image {
    height: 300px;
  }

  .card-avatar {
    font-size: 5rem;
  }

  .action-buttons .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .matches-container {
    padding: 1rem 0;
  }

  .matches-header {
    padding: 0 1rem;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat {
    flex-direction: column;
    text-align: center;
    padding: 0.75rem;
    gap: 0.25rem;
  }

  .stat-icon {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .stat-value {
    font-size: 1.125rem;
  }

  .matches-content {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  .profile-card {
    max-width: 100%;
  }

  .card-image {
    height: 250px;
  }

  .card-avatar {
    font-size: 4rem;
  }

  .card-info {
    padding: 1rem;
  }

  .action-buttons {
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .action-buttons .btn {
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .empty-state {
    padding: 1.5rem;
  }

  .interests-tags {
    gap: 0.5rem;
  }

  .interest-tag {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Match Popup */
.match-popup {
  position: fixed;
  inset: 0;
  background: rgba(204, 50, 140, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(4px);
}

.match-popup-content {
  background: white;
  border-radius: 1.5rem;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(204, 50, 140, 0.35);
  animation: popupScale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupScale {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.match-hearts {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: heartBounce 0.7s ease-in-out infinite alternate;
}

@keyframes heartBounce {
  from { transform: scale(1);    }
  to   { transform: scale(1.18); }
}

.match-popup-content h2 {
  color: var(--heart-primary);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.match-popup-content p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Swipe indicators ─────────────────────────────────────────────────── */

.swipe-indicator {
  position: absolute;
  top: 1.75rem;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: 0.4rem;
  border: 3px solid;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: opacity 0.08s ease;
}

.swipe-like {
  left: 1.5rem;
  color: #27ae60;
  border-color: #27ae60;
  transform: rotate(-12deg);
}

.swipe-pass {
  right: 1.5rem;
  color: #e74c3c;
  border-color: #e74c3c;
  transform: rotate(12deg);
}

/* ── Card overlay (name/city over gradient) ───────────────────────────── */

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.72) 100%);
  padding: 3.5rem 1.5rem 1.25rem;
}

.card-overlay h2 {
  color: white;
  font-size: 1.5rem;
  margin: 0 0 0.2rem;
  font-weight: 700;
}

.card-overlay p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Hero card stack ──────────────────────────────────────────────────── */

.card-stack {
  position: relative;
  width: 280px;
  height: 390px;
  margin: 0 auto;
}

.stack-card {
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.stack-card-3 {
  background: var(--heart-light);
  transform: rotate(9deg) translate(18px, 12px);
  opacity: 0.35;
}

.stack-card-2 {
  background: linear-gradient(145deg, var(--heart-dark), var(--heart-primary));
  transform: rotate(-5deg) translate(-12px, 7px);
  opacity: 0.6;
}

.stack-card-1 {
  background: linear-gradient(160deg, var(--heart-primary) 0%, var(--heart-light) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1.5rem 1.5rem;
  overflow: hidden;
  animation: cardFloat 3.5s ease-in-out infinite;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

.stack-avatar {
  font-size: 6.5rem;
  margin-top: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.stack-label {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.875rem;
  padding: 0.875rem 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stack-label strong {
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
}

.stack-label span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .card-stack {
    width: 240px;
    height: 330px;
  }

  .stack-avatar {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .card-stack {
    width: 200px;
    height: 280px;
  }

  .stack-avatar {
    font-size: 4rem;
  }

  .stack-label strong {
    font-size: 1rem;
  }
}

/* ── Nav notification badge ─────────────────────────────────────────────── */

.navbar-link {
  position: relative;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.1rem;
  height: 1.1rem;
  border-radius: 1rem;
  padding: 0 0.25rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  line-height: 1;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ── Compatibility tag on profile card ───────────────────────────────────── */

.compat-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(204, 50, 140, 0.1), rgba(232, 75, 154, 0.15));
  color: var(--heart-primary);
  border: 1.5px solid rgba(204, 50, 140, 0.35);
  border-radius: 2rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* ── NEW badge in matches list ───────────────────────────────────────────── */

.match-new-badge {
  display: inline-flex;
  align-items: center;
  background: var(--heart-primary);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

/* ── Age range sliders ───────────────────────────────────────────────────── */

.age-range-display {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heart-primary);
  margin-bottom: 1.5rem;
}

.age-sliders {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.age-slider-row {
  display: grid;
  grid-template-columns: 90px 1fr 2.5rem;
  align-items: center;
  gap: 1rem;
}

.age-slider-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.age-slider-row input[type="range"] {
  width: 100%;
}

.age-slider-row span {
  font-weight: 700;
  color: var(--heart-primary);
  font-size: 1rem;
  text-align: right;
}

/* ── Dark mode ──────────────────────────────────────────────────────────── */

body.dark-mode {
  --bg-light: #17101f;
  --bg-white: #221530;
  --text-dark: #f0e0f0;
  --text-muted: #c0a0c0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
}

body.dark-mode footer {
  background: #0e0915;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="password"],
body.dark-mode select,
body.dark-mode textarea {
  background: var(--bg-light);
  border-color: rgba(204, 50, 140, 0.35);
  color: var(--text-dark);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #7a5a7a;
}

body.dark-mode .auth-gate {
  background: #2a2010;
  border-color: #a06000;
  color: #f0c060;
}

body.dark-mode .option-card {
  background: var(--bg-white);
  border-color: rgba(204, 50, 140, 0.3);
}

body.dark-mode .card-image {
  background: linear-gradient(135deg, #7a1a55 0%, var(--heart-primary) 100%);
}

/* ── Matches tabs ───────────────────────────────────────────────────────── */

.matches-tabs-bar {
  display: flex;
  gap: 0;
  max-width: 500px;
  margin: 0 auto 1.5rem;
  width: 100%;
  padding: 0 1.5rem;
  border-radius: 0.625rem;
  overflow: hidden;
  border: 2px solid var(--heart-primary);
}

.matches-tab {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: var(--heart-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.matches-tab.active {
  background: var(--heart-primary);
  color: white;
}

.matches-tab:not(.active):hover {
  background: var(--bg-light);
}

/* ── Matches list ───────────────────────────────────────────────────────── */

.matches-list-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  width: 100%;
}

.matches-list-empty {
  margin-top: 2rem;
}

.match-list-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-white);
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.match-list-card:hover {
  border-color: var(--heart-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.match-list-avatar {
  font-size: 2.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.match-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.match-list-info strong {
  color: var(--text-dark);
  font-size: 1rem;
}

.match-list-info span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.match-list-tags {
  color: var(--heart-primary);
  font-size: 0.8rem;
  font-weight: 500;
}

/* ── Chat modal ─────────────────────────────────────────────────────────── */

.chat-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.chat-container {
  background: var(--bg-white);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin: 1rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--bg-light);
  background: var(--bg-white);
  flex-shrink: 0;
}

.chat-back-btn {
  min-width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 1.1rem;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-info strong {
  font-size: 1.05rem;
  color: var(--text-dark);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-light);
}

.chat-bubble {
  max-width: 75%;
  padding: 0.6rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.bubble-match {
  background: var(--bg-white);
  color: var(--text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.bubble-user {
  background: var(--heart-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

.chat-input-bar {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 2px solid var(--bg-light);
  background: var(--bg-white);
  flex-shrink: 0;
}

.chat-input-bar input {
  flex: 1;
  border-radius: 2rem;
  padding: 0.65rem 1.25rem;
  border: 2px solid #e0d5e0;
}

.chat-input-bar input:focus {
  border-color: var(--heart-primary);
}

/* ── Profile page ───────────────────────────────────────────────────────── */

.profile-page-title {
  text-align: center;
  color: var(--heart-primary);
  margin-bottom: 2rem;
}

.profile-page-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

.profile-main-card {
  background: var(--bg-white);
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: sticky;
  top: 5rem;
}

.profile-display-avatar {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 12px rgba(204, 50, 140, 0.3));
}

.profile-avatar-section {
  margin-top: 1.5rem;
  text-align: center;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.avatar-option {
  font-size: 1.5rem;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  padding: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.avatar-option:hover {
  border-color: var(--heart-primary);
  transform: scale(1.1);
}

.avatar-option.selected {
  border-color: var(--heart-primary);
  background: rgba(204, 50, 140, 0.12);
  box-shadow: 0 0 0 3px rgba(204, 50, 140, 0.2);
}

.profile-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-section-card {
  background: var(--bg-white);
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.profile-section-card h3 {
  color: var(--heart-primary);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.profile-section-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0d5e0;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
  background: var(--bg-white);
  color: var(--text-dark);
}

.profile-section-card textarea:focus {
  outline: none;
  border-color: var(--heart-primary);
  box-shadow: 0 0 0 3px rgba(204, 50, 140, 0.1);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-light);
  border-radius: 0.75rem;
  padding: 1rem;
  gap: 0.25rem;
}

.profile-prefs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-light);
  font-size: 0.9rem;
  gap: 1rem;
}

.profile-pref-row span {
  color: var(--text-muted);
  flex-shrink: 0;
}

.profile-pref-row strong {
  color: var(--text-dark);
  text-align: right;
}

@media (max-width: 900px) {
  .profile-page-grid {
    grid-template-columns: 1fr;
  }

  .profile-main-card {
    position: static;
  }
}

@media (max-width: 480px) {
  .matches-tabs-bar {
    margin-bottom: 1rem;
  }

  .chat-container {
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .match-list-card {
    padding: 0.875rem 1rem;
  }

  .match-list-avatar {
    font-size: 2.25rem;
  }
}
