/* === Match2Chat Design System v2 === */

/* --- Light Theme (default) --- */
:root {
  --canvas: #E9E1DA;
  --bg: #FBF6F2;
  --surface: #FFFFFF;
  --surface-2: #FCEFEA;
  --surface-3: #F2ECFA;
  --text: #2E2733;
  --text-2: #6F6775;
  --text-3: #A79FAC;
  --border: #F1E7E1;
  --border-2: #ECE2EC;
  --primary: #FB6F8D;
  --primary-strong: #F2557A;
  --primary-soft: #FFE5EA;
  --lilac: #9A86E0;
  --lilac-soft: #ECE6FB;
  --peach: #FF9E8C;
  --peach-soft: #FFE9DC;
  --online: #43C9A0;
  --verify: #4C8DFF;
  --grad-primary: linear-gradient(135deg, #FF9E8C 0%, #FB6F8D 60%, #F2557A 100%);
  --grad-lilac: linear-gradient(135deg, #B9A8F2, #9A86E0);
  --grad-hero: linear-gradient(160deg, #FFE9DC 0%, #FFE0E8 45%, #F0E8FC 100%);
  --shadow: 0 2px 10px rgba(60, 40, 55, .05);
  --shadow-lg: 0 18px 50px -18px rgba(120, 70, 90, .35);
}

/* --- Dark Theme --- */
[data-app-theme="dark"] {
  --canvas: #0C0A10;
  --bg: #161219;
  --surface: #211B27;
  --surface-2: #281F2E;
  --surface-3: #241E2E;
  --text: #F3EDF1;
  --text-2: #B3A9BC;
  --text-3: #7C7286;
  --border: #312938;
  --border-2: #352B3C;
  --primary: #FB7E99;
  --primary-strong: #FB6F8D;
  --primary-soft: #3A2230;
  --lilac: #B3A2F0;
  --lilac-soft: #2C2440;
  --peach: #FFA995;
  --peach-soft: #3A2A26;
  --online: #4FD3AB;
  --verify: #6BA0FF;
  --grad-hero: linear-gradient(160deg, #2A1F2B 0%, #2A1D29 45%, #231E33 100%);
  --shadow: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 50px -18px rgba(0, 0, 0, .6);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background .45s ease, color .45s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Gabarito', sans-serif;
  margin: 0;
  line-height: 1.15;
  letter-spacing: -.02em;
}

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

a:hover {
  text-decoration: underline;
}

img { max-width: 100%; height: auto; }

button {
  font-family: 'Hanken Grotesk', sans-serif;
}

/* --- Material Symbols --- */
.msr {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'opsz' 24, 'GRAD' 0;
}

.fill {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'opsz' 24, 'GRAD' 0;
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  0% { transform: scale(.5); opacity: 0; }
  65% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes pulseRing {
  0% { transform: scale(.9); opacity: .5; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes floatHeart {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  to { background-position: 200% 0; }
}

/* --- Scrollbar --- */
.m2c-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.m2c-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-family: 'Hanken Grotesk', sans-serif;
  animation: toastIn .35s ease both;
}

.m2c-toast.removing {
  animation: toastOut .25s ease both;
}

.m2c-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m2c-toast-icon .msr { font-size: 20px; color: #fff; }

.m2c-toast.toast-success .m2c-toast-icon { background: var(--online); }
.m2c-toast.toast-danger .m2c-toast-icon,
.m2c-toast.toast-error .m2c-toast-icon { background: var(--primary-strong); }
.m2c-toast.toast-info .m2c-toast-icon { background: var(--lilac); }
.m2c-toast.toast-warning .m2c-toast-icon { background: #f0a500; }

.m2c-toast-body {
  flex: 1;
  min-width: 0;
}

.m2c-toast-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.3;
}

.m2c-toast-msg {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.4;
  margin-top: 1px;
}

.m2c-toast-close {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
  flex-shrink: 0;
  line-height: 1;
}

.m2c-toast-close:hover { color: var(--text); }

.m2c-toast-progress {
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
}

.m2c-toast-progress-bar {
  height: 100%;
  border-radius: 2px;
  animation: toastProgress 4s linear both;
}

.m2c-toast.toast-success .m2c-toast-progress-bar { background: var(--online); }
.m2c-toast.toast-danger .m2c-toast-progress-bar,
.m2c-toast.toast-error .m2c-toast-progress-bar { background: var(--primary-strong); }
.m2c-toast.toast-info .m2c-toast-progress-bar { background: var(--lilac); }
.m2c-toast.toast-warning .m2c-toast-progress-bar { background: #f0a500; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(30px) scale(.95); }
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* --- Glassmorphism Utility --- */
.m2c-glass {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* --- Gradient Primary Button --- */
.btn-m2c-primary {
  width: 100%;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 16px;
  font: 700 16px 'Hanken Grotesk', sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 26px -8px rgba(242, 85, 122, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s, box-shadow .15s;
}

.btn-m2c-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -8px rgba(242, 85, 122, .7);
}

.btn-m2c-primary:disabled {
  cursor: default;
  opacity: .7;
  transform: none;
}

/* --- Surface Card --- */
.card-m2c {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* --- Page Containers --- */
.m2c-page {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  padding: 0 18px;
}

.m2c-page-wide {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  padding: 0 18px;
}

.m2c-page-narrow {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
  padding: 0 18px;
}

/* --- Sub-page Header --- */
.m2c-subpage-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.m2c-subpage-header .back-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
}

.m2c-subpage-header .page-title {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

/* --- Hero Banner --- */
.m2c-hero {
  background: var(--grad-hero);
  padding: 24px 20px;
  text-align: center;
}

.m2c-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: var(--shadow);
}

.m2c-hero h2 {
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 5px;
}

.m2c-hero p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
}

/* --- Settings Menu Item --- */
.m2c-menu-item,
.m2c-menu-item:hover,
.m2c-menu-item:focus,
.m2c-menu-item:active,
.m2c-menu-item:visited {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 14px 15px;
  cursor: pointer;
  transition: padding-left .2s;
  color: var(--text);
  font-family: 'Hanken Grotesk', sans-serif;
  text-decoration: none;
}

.m2c-menu-item:last-child {
  border-bottom: none;
}

.m2c-menu-item:hover {
  padding-left: 20px;
  background: none;
}

.m2c-menu-item .menu-label {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

/* --- Toggle Switch --- */
.m2c-toggle {
  position: relative;
  width: 50px;
  height: 29px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.m2c-toggle .toggle-track {
  display: flex;
  width: 50px;
  height: 29px;
  border-radius: 15px;
  background: var(--border-2);
  align-items: center;
  justify-content: flex-start;
  padding: 3px;
  transition: all .2s;
}

.m2c-toggle.active .toggle-track {
  background: var(--online);
  justify-content: flex-end;
}

.m2c-toggle .toggle-thumb {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

/* --- Badge --- */
.m2c-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Desktop Top Navigation --- */
.m2c-topnav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.m2c-topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.m2c-topnav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.m2c-topnav-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -4px rgba(251, 111, 141, .6);
}

.m2c-topnav-brand-text {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
}

.m2c-topnav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.m2c-topnav-links .nav-item {
  display: none;
}

.m2c-topnav-links .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: background .2s, color .2s;
  position: relative;
  white-space: nowrap;
}

.m2c-topnav-links .nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.m2c-topnav-links .nav-link.active {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.m2c-topnav-links .nav-link .badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
}

.m2c-topnav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Theme Toggle --- */
.m2c-theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px 7px 9px;
  cursor: pointer;
  color: var(--text-2);
  box-shadow: var(--shadow);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .2s;
}

.m2c-theme-toggle:hover {
  background: var(--surface-2);
}

/* --- Mobile Bottom Navigation --- */
.m2c-bottomnav {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 8px 6px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.m2c-bottomnav .nav-link {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  position: relative;
  text-decoration: none;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  transition: color .2s;
}

.m2c-bottomnav .nav-link.active {
  color: var(--primary);
}

.m2c-bottomnav .nav-link.active .msr {
  color: var(--primary);
}

.m2c-bottomnav .nav-link .msr {
  font-size: 25px;
  color: var(--text-3);
  transition: color .2s;
}

.m2c-bottomnav .nav-link .badge {
  position: absolute;
  top: -3px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* --- Responsive Breakpoints --- */
@media (min-width: 768px) {
  .m2c-topnav { display: block; }
  .m2c-bottomnav { display: none !important; }
  body { padding-bottom: 0; }
}

@media (max-width: 767px) {
  .m2c-topnav { display: none !important; }
  .m2c-bottomnav { display: flex; }
  body { padding-bottom: 64px; }
}

/* --- Form Controls (Bootstrap override) --- */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.modal-header {
  background: var(--grad-primary);
  color: #fff;
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 18px 20px;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-header .modal-title {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
}

.modal-body {
  padding: 20px;
  color: var(--text);
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}

.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 15px;
  font: 500 14px 'Hanken Grotesk', sans-serif;
  background: var(--surface-2);
  color: var(--text);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(251, 111, 141, .15);
  background: var(--surface);
  color: var(--text);
}

.form-label {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 6px;
}

/* --- Gender Selector --- */
.gender-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.gender-option {
  position: relative;
  cursor: pointer;
}

.gender-option input[type="radio"] {
  display: none;
}

.gender-option .gender-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  transition: all .2s;
  color: var(--text-2);
}

.gender-option input[type="radio"]:checked + .gender-label {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}

/* --- Filter Buttons --- */
.filter-save-btn {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 11px 20px;
  font: 700 14px 'Hanken Grotesk', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 14px -4px rgba(242, 85, 122, .5);
}

.filter-close-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 20px;
  font: 600 14px 'Hanken Grotesk', sans-serif;
  cursor: pointer;
}

/* --- Footer --- */
footer.m2c-footer {
  text-align: center;
  padding: 22px 18px 26px;
}

footer.m2c-footer .footer-tagline {
  font-family: 'Gabarito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 8px;
}

footer.m2c-footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 12px;
}

footer.m2c-footer .footer-links a {
  color: var(--text-3);
  text-decoration: none;
}

footer.m2c-footer .footer-links a:hover {
  color: var(--primary);
}

footer.m2c-footer .footer-copy {
  font-size: 11px;
  color: var(--text-3);
}

@media (max-width: 767px) {
  footer.m2c-footer { display: none; }
}

/* --- Streak Celebration --- */
.streak-celebration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  animation: fadeUp .4s both;
}

.streak-celebration .celebration-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-primary);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
