/* ==========================================================================
   TWINKR DESIGN SYSTEM
   Mobile-first, chaleureux, accessible et volontairement léger.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Palette stricte : rouge Twinkr, beige, noir et blanc. */
  --color-primary: #e94e51;
  --color-primary-hover: color-mix(in srgb, var(--color-primary) 86%, black);
  --color-primary-active: color-mix(in srgb, var(--color-primary) 74%, black);
  --color-primary-soft: color-mix(in srgb, var(--color-primary) 11%, white);
  --color-primary-subtle: color-mix(in srgb, var(--color-primary) 22%, white);
  --color-primary-alpha: rgba(233, 78, 81, .16);
  --color-secondary: #e5d1be;
  --color-secondary-soft: color-mix(in srgb, var(--color-secondary) 32%, white);
  --color-secondary-alpha: rgba(229, 209, 190, .54);
  --color-bg: color-mix(in srgb, var(--color-secondary) 22%, white);
  --color-surface: #fff;
  --color-surface-soft: color-mix(in srgb, var(--color-secondary) 14%, white);
  --color-border: color-mix(in srgb, var(--color-secondary) 68%, white);
  --color-border-strong: color-mix(in srgb, var(--color-secondary) 82%, black);
  --color-text: rgba(0, 0, 0, .84);
  --color-text-muted: rgba(0, 0, 0, .58);
  --color-text-subtle: rgba(0, 0, 0, .42);
  --color-white-alpha: rgba(255, 255, 255, .92);
  --color-black-alpha: rgba(0, 0, 0, .12);

  /* Alias internes utilisés par les composants historiques. */
  --twk-primary-50: var(--color-primary-soft);
  --twk-primary-100: var(--color-primary-subtle);
  --twk-primary-200: color-mix(in srgb, var(--color-primary) 32%, white);
  --twk-primary-300: color-mix(in srgb, var(--color-primary) 48%, white);
  --twk-primary-400: color-mix(in srgb, var(--color-primary) 70%, white);
  --twk-primary-500: var(--color-primary);
  --twk-primary-600: var(--color-primary);
  --twk-primary-700: var(--color-primary-hover);
  --twk-primary-800: var(--color-primary-active);
  --twk-primary: var(--color-primary);
  --twk-primary-dark: var(--color-primary-hover);

  /* Fond des champs de formulaire : dérivé de --color-primary. */
  --twk-input-bg: color-mix(in srgb, var(--color-primary) 8%, white);
  --twk-input-bg-hover: color-mix(in srgb, var(--color-primary) 13%, white);
  --twk-input-bg-focus: color-mix(in srgb, var(--color-primary) 5%, white);

  --twk-secondary-50: var(--color-secondary-soft);
  --twk-secondary-100: color-mix(in srgb, var(--color-secondary) 48%, white);
  --twk-secondary-300: color-mix(in srgb, var(--color-secondary) 76%, white);
  --twk-secondary-500: var(--color-secondary);
  --twk-secondary-600: color-mix(in srgb, var(--color-secondary) 86%, black);

  --twk-success: var(--color-primary-hover);
  --twk-success-soft: var(--color-primary-soft);
  --twk-danger: var(--color-primary-active);
  --twk-danger-soft: var(--color-primary-soft);
  --twk-warning: var(--color-primary-hover);
  --twk-warning-soft: var(--color-secondary-soft);
  --twk-info: var(--color-primary);
  --twk-info-soft: var(--color-secondary-soft);

  --twk-ink: var(--color-text);
  --twk-text: var(--color-text);
  --twk-muted: var(--color-text-muted);
  --twk-subtle: var(--color-text-subtle);
  --twk-border: var(--color-border);
  --twk-border-strong: var(--color-border-strong);
  --twk-surface: var(--color-surface);
  --twk-surface-soft: var(--color-surface-soft);
  --twk-page: var(--color-bg);
  --twk-page-warm: var(--color-bg);

  --twk-space-1: .25rem;
  --twk-space-2: .5rem;
  --twk-space-3: .75rem;
  --twk-space-4: 1rem;
  --twk-space-5: 1.25rem;
  --twk-space-6: 1.5rem;
  --twk-space-8: 2rem;
  --twk-space-10: 2.5rem;
  --twk-space-12: 3rem;
  --twk-space-16: 4rem;

  --twk-radius-xs: .375rem;
  --twk-radius-sm: .625rem;
  --twk-radius-md: .875rem;
  --twk-radius-lg: 1.125rem;
  --twk-radius-xl: 1.5rem;
  --twk-radius-round: 999px;
  --twk-radius: var(--twk-radius-md);
  --twk-control-sm: 36px;
  --twk-control: 44px;
  --twk-control-lg: 50px;
  --twk-content-width: 1160px;
  --twk-app-width: 1180px;

  --twk-shadow-xs: 0 1px 2px rgba(0, 0, 0, .04);
  --twk-shadow-sm: 0 6px 20px rgba(0, 0, 0, .07);
  --twk-shadow-md: 0 14px 40px rgba(0, 0, 0, .10);
  --twk-shadow-lg: 0 24px 64px rgba(0, 0, 0, .14);
  --twk-shadow: var(--twk-shadow-sm);

  --twk-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --twk-font-display: var(--twk-font);
  --twk-transition: 180ms cubic-bezier(.2, .7, .3, 1);

  --bs-primary: var(--color-primary);
  --bs-primary-rgb: 233, 78, 81;
  --bs-secondary: var(--color-secondary);
  --bs-secondary-rgb: 229, 209, 190;
  --bs-danger: var(--color-primary-active);
  --bs-danger-rgb: 233, 78, 81;
  --bs-success: var(--color-primary-hover);
  --bs-success-rgb: 233, 78, 81;
  --bs-warning: var(--color-secondary);
  --bs-warning-rgb: 229, 209, 190;
  --bs-info: var(--color-primary);
  --bs-info-rgb: 233, 78, 81;
  --bs-link-color: var(--color-primary-hover);
  --bs-link-hover-color: var(--color-primary-active);
  --bs-body-font-family: var(--twk-font);
  --bs-body-color: var(--twk-text);
  --bs-body-bg: var(--twk-page);
  --bs-border-color: var(--twk-border);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  min-width: 320px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--twk-text);
  background: var(--twk-page);
  font-family: var(--twk-font);
  font-size: .975rem;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body:not(.app-body) {
  display: flex;
  flex-direction: column;
}

body:not(.app-body) > main,
body:not(.app-body) > section {
  width: 100%;
  flex: 1 0 auto;
}

img { max-width: 100%; }
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  vertical-align: -.2em;
}
a { color: var(--twk-primary-700); text-underline-offset: .18em; }
a:hover { color: var(--twk-primary-800); }

h1, h2, h3, h4, h5, h6 {
  color: var(--twk-ink);
  font-family: var(--twk-font-display);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}

h1, h1.h1, h1.h2, h1.h3, h1.h4, h1.h5, h1.h6 {
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -.045em;
}

p:last-child { margin-bottom: 0; }
.text-secondary, .text-muted { color: var(--twk-muted) !important; }
.small, small { line-height: 1.5; }

:focus-visible {
  outline: 3px solid var(--color-primary-alpha) !important;
  outline-offset: 2px;
}

::selection {
  color: var(--twk-ink);
  background: var(--twk-primary-200);
}

/* ==========================================================================
   PRIMITIVES / BOOTSTRAP OVERRIDES
   ========================================================================== */

.container {
  --bs-gutter-x: 0;
  width: min(calc(100% - 2rem), var(--twk-content-width));
  max-width: var(--twk-content-width);
  padding-inline: 0;
}

.card,
.twk-card {
  overflow: hidden;
  border: 0;
  border-radius: var(--twk-radius-lg);
  background: var(--twk-surface);
  box-shadow: var(--twk-shadow-xs);
}

.card-body { padding: 1.25rem; }
.card-footer {
  padding: 1rem 1.25rem;
  border-color: var(--twk-border);
  background: var(--twk-surface);
}

.btn {
  min-height: var(--twk-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .625rem 1rem;
  border-radius: var(--twk-radius-sm);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
  transition: color var(--twk-transition), background-color var(--twk-transition),
    border-color var(--twk-transition), box-shadow var(--twk-transition),
    transform var(--twk-transition);
}

.btn:hover { transform: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { cursor: not-allowed; transform: none; opacity: .48; }
.btn-sm { min-height: var(--twk-control-sm); padding: .42rem .75rem; font-size: .8rem; border-radius: var(--twk-radius-sm); }
.btn-lg { min-height: var(--twk-control-lg); padding: .75rem 1.25rem; font-size: .95rem; }

.btn-primary {
  --bs-btn-bg: var(--twk-primary);
  --bs-btn-border-color: var(--twk-primary);
  --bs-btn-hover-bg: var(--twk-primary-dark);
  --bs-btn-hover-border-color: var(--twk-primary-dark);
  --bs-btn-active-bg: var(--twk-primary-800);
  --bs-btn-active-border-color: var(--twk-primary-800);
  --bs-btn-disabled-bg: var(--twk-primary-400);
  --bs-btn-disabled-border-color: var(--twk-primary-400);
  box-shadow: none;
}

.btn-outline-primary,
.btn-soft-primary {
  --bs-btn-color: var(--twk-primary-700);
  --bs-btn-bg: color-mix(in srgb, var(--twk-primary) 10%, transparent);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: white;
  --bs-btn-hover-bg: var(--twk-primary);
  --bs-btn-hover-border-color: var(--twk-primary);
  --bs-btn-active-color: white;
  --bs-btn-active-bg: var(--twk-primary-dark);
  --bs-btn-active-border-color: var(--twk-primary-dark);
}

.btn-secondary {
  --bs-btn-color: var(--twk-text);
  --bs-btn-bg: var(--color-secondary);
  --bs-btn-border-color: var(--color-secondary);
  --bs-btn-hover-color: var(--twk-text);
  --bs-btn-hover-bg: color-mix(in srgb, var(--color-secondary) 86%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--color-secondary) 86%, black);
  --bs-btn-active-color: var(--twk-text);
  --bs-btn-active-bg: color-mix(in srgb, var(--color-secondary) 76%, black);
  --bs-btn-active-border-color: color-mix(in srgb, var(--color-secondary) 76%, black);
}

.btn-outline-secondary,
.btn-outline-danger {
  --bs-btn-color: var(--twk-primary-700);
  --bs-btn-bg: color-mix(in srgb, var(--twk-primary) 10%, transparent);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: white;
  --bs-btn-hover-bg: var(--twk-primary);
  --bs-btn-hover-border-color: var(--twk-primary);
  --bs-btn-active-color: white;
  --bs-btn-active-bg: var(--twk-primary-dark);
  --bs-btn-active-border-color: var(--twk-primary-dark);
}

/* Pastilles de sélection multiple (intérêts, langues, préférences…) : état
   non sélectionné en gris neutre plutôt qu'en primaire, pour bien le
   distinguer de l'état sélectionné (btn-secondary). */
.rounded-pill.btn-outline-secondary {
  --bs-btn-color: var(--twk-text);
  --bs-btn-bg: color-mix(in srgb, var(--twk-text) 7%, transparent);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--twk-text);
  --bs-btn-hover-bg: color-mix(in srgb, var(--twk-text) 13%, transparent);
  --bs-btn-hover-border-color: transparent;
}

.btn-success {
  --bs-btn-bg: var(--twk-success);
  --bs-btn-border-color: var(--twk-success);
  --bs-btn-hover-bg: var(--twk-primary-800);
  --bs-btn-hover-border-color: var(--twk-primary-800);
}

.btn-danger {
  --bs-btn-bg: var(--twk-danger);
  --bs-btn-border-color: var(--twk-danger);
  --bs-btn-hover-bg: var(--twk-primary-800);
  --bs-btn-hover-border-color: var(--twk-primary-800);
  --bs-btn-active-bg: var(--twk-primary-800);
  --bs-btn-active-border-color: var(--twk-primary-800);
}

.btn-link { min-height: auto; color: var(--twk-primary-700); box-shadow: none; }
.btn-white { border: 1px solid var(--twk-border); background: var(--twk-surface); color: var(--twk-text); }
.btn-light {
  --bs-btn-color: var(--twk-text);
  --bs-btn-bg: var(--twk-surface);
  --bs-btn-border-color: var(--twk-border-strong);
  --bs-btn-hover-color: var(--twk-primary-800);
  --bs-btn-hover-bg: var(--twk-primary-50);
  --bs-btn-hover-border-color: var(--twk-primary-300);
  --bs-btn-active-color: var(--twk-primary-800);
  --bs-btn-active-bg: var(--twk-primary-100);
  --bs-btn-active-border-color: var(--twk-primary-400);
}
.btn-outline-dark,
.btn-outline-light {
  --bs-btn-color: var(--twk-primary-700);
  --bs-btn-bg: color-mix(in srgb, var(--twk-primary) 10%, transparent);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: white;
  --bs-btn-hover-bg: var(--twk-primary);
  --bs-btn-hover-border-color: var(--twk-primary);
  --bs-btn-active-color: white;
  --bs-btn-active-bg: var(--twk-primary-dark);
  --bs-btn-active-border-color: var(--twk-primary-dark);
}
.rounded-2xl { border-radius: var(--twk-radius-md) !important; }

.form-label {
  margin-bottom: .4rem;
  color: var(--twk-text);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 1;
}

.form-control,
.form-select,
.input-group-text {
  min-height: var(--twk-control);
  border: 0;
  border-radius: var(--twk-radius-md);
  color: var(--twk-ink);
  background-color: var(--twk-input-bg);
  font-size: .9rem;
  box-shadow: none;
  outline: 0;
  transition: background-color var(--twk-transition), box-shadow var(--twk-transition);
}

.form-control,
.form-select { padding: .6rem .75rem; }
.form-control[type="file"] { padding: .35rem; }
.form-control[type="file"]::file-selector-button {
  min-height: 34px;
  padding: .4rem .7rem;
  margin: -.1rem .65rem -.1rem -.1rem;
  border: 0;
  border-radius: var(--twk-radius-sm);
  color: var(--twk-text);
  background: var(--twk-secondary-100);
  font: inherit;
  font-weight: 600;
}
textarea.form-control { min-height: 120px; resize: vertical; }
.form-select[multiple] { min-height: 116px; }
.form-control::placeholder { color: var(--twk-subtle); opacity: 1; }
.form-control:hover, .form-select:hover { background-color: var(--twk-input-bg-hover); }
.form-control:focus, .form-select:focus {
  border: 0;
  outline: 0;
  background-color: var(--twk-input-bg-focus);
  box-shadow: none;
}
.form-control:focus-visible, .form-select:focus-visible { outline: 0 !important; }

.input-group > .form-control:not(:last-child) {
  border-radius: var(--twk-radius-md) 0 0 var(--twk-radius-md);
}
.input-group-text {
  padding-inline: .9rem;
  border-radius: 0 var(--twk-radius-md) var(--twk-radius-md) 0;
  color: var(--twk-muted);
}
.password-eye {
  cursor: pointer;
  color: var(--twk-muted);
  background: var(--twk-input-bg);
  user-select: none;
}
.password-eye:hover,
.password-eye:focus,
.password-eye:focus-visible {
  color: var(--twk-muted);
  outline: 0;
  background:
    linear-gradient(rgba(0, 0, 0, .06), rgba(0, 0, 0, .06)),
    var(--twk-input-bg);
  box-shadow: none;
}
.form-text { margin-top: .45rem; color: var(--twk-muted); font-size: .8rem; }

.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  border-color: var(--twk-border-strong);
}
.form-check-input:checked { border-color: var(--twk-primary); background-color: var(--twk-primary); }
.form-check-input:focus { box-shadow: none; }
.form-switch .form-check-input { width: 2.35rem; height: 1.3rem; }
.form-range::-webkit-slider-thumb { background: var(--twk-primary); }
.form-range::-moz-range-thumb { border-color: var(--twk-primary); background: var(--twk-primary); }
.btn > i { line-height: 1; }

.badge {
  padding: .38rem .58rem;
  border-radius: var(--twk-radius-round);
  font-weight: 600;
}
.bg-primary, .text-bg-primary { background-color: var(--twk-primary) !important; }
.bg-danger, .bg-success, .bg-info { background-color: var(--twk-primary) !important; }
.bg-warning, .bg-secondary { background-color: var(--twk-secondary) !important; }
.bg-light { background-color: var(--twk-surface-soft) !important; }
.text-danger, .text-success, .text-info { color: var(--twk-primary-800) !important; }
.text-warning, .text-secondary { color: var(--twk-muted) !important; }
.text-bg-danger,
.text-bg-success,
.text-bg-primary {
  color: white !important;
  background: var(--twk-primary) !important;
}
.text-bg-secondary,
.text-bg-light {
  color: var(--twk-text) !important;
  background: var(--twk-secondary-100) !important;
}
.btn-secondary.text-white { color: var(--twk-text) !important; }

.is-valid,
.was-validated .form-control:valid,
.was-validated .form-select:valid {
  border: 0 !important;
  background-image: none;
}
.is-invalid,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  border: 0 !important;
  background-color: color-mix(in srgb, var(--twk-primary) 14%, var(--color-secondary)) !important;
}
.valid-feedback,
.invalid-feedback { color: var(--twk-primary-800); }

.alert {
  padding: .9rem 1rem;
  border-width: 1px;
  border-radius: var(--twk-radius-md);
  font-size: .9rem;
}
.alert-success { border-color: var(--twk-primary-300); color: var(--twk-primary-800); background: var(--twk-success-soft); }
.alert-danger { border-color: var(--twk-primary-400); color: var(--twk-danger); background: var(--twk-danger-soft); }
.alert-info { border-color: var(--twk-secondary-300); color: var(--twk-text); background: var(--twk-info-soft); }
.alert-warning, .alert-secondary { border-color: var(--twk-secondary-300); color: var(--twk-text); background: var(--twk-secondary-50); }

.dropdown-menu {
  padding: .45rem;
  border-color: var(--twk-border);
  border-radius: var(--twk-radius-md);
  box-shadow: var(--twk-shadow-md);
}
.dropdown-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--twk-radius-sm); font-size: .9rem; }
.dropdown-item:hover, .dropdown-item:focus { color: var(--twk-ink); background: var(--twk-primary-50); }
.dropdown-item .material-symbols-rounded { width: 1.1rem; text-align: center; color: var(--twk-muted); font-size: 1.1rem; }
.site-nav .dropdown-toggle .material-symbols-rounded { margin-right: .4rem; }
.dropdown-item-logout,
.dropdown-item-logout:hover,
.dropdown-item-logout:focus { color: white; background: var(--twk-danger); margin-top: .25rem; }
.dropdown-item-logout .material-symbols-rounded { color: white; }

.modal-content {
  border: 1px solid var(--twk-border);
  border-radius: var(--twk-radius-xl);
  box-shadow: var(--twk-shadow-lg);
}

.toast-container { z-index: 2000; }
.toast {
  border-radius: var(--twk-radius-md);
  box-shadow: var(--twk-shadow-md);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--twk-transition), transform var(--twk-transition);
}
.toast.show { opacity: 1; transform: translateY(0); }

.pagination { gap: .3rem; flex-wrap: wrap; }
.page-link {
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--twk-border);
  border-radius: var(--twk-radius-sm) !important;
  color: var(--twk-text);
  background: var(--twk-surface);
}
.active > .page-link { border-color: var(--twk-primary); background: var(--twk-primary); }

/* ==========================================================================
   PUBLIC NAVIGATION / FOOTER
   ========================================================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1050;
  min-height: 64px;
  padding: .55rem 0;
  border-bottom: 1px solid var(--twk-border);
  background: var(--color-white-alpha);
  backdrop-filter: blur(18px) saturate(150%);
}

.twinkr-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--twk-ink);
  font-size: 1.08rem;
  font-weight: 680;
  letter-spacing: -.035em;
  text-decoration: none;
}

.twinkr-wordmark:hover { color: var(--twk-ink); }
.twinkr-wordmark img { display: block; flex: 0 0 auto; object-fit: contain; }
.brand-logo-long { width: 142px; height: auto; }
.brand-logo-mark { display: none !important; width: 34px; height: 34px; }
.footer-brand .brand-logo-long { width: 132px; }

.site-nav .nav-link {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: .42rem .65rem !important;
  border-radius: var(--twk-radius-sm);
  color: var(--twk-muted);
  font-size: .9rem;
  font-weight: 500;
}
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--twk-primary-700); background: var(--twk-primary-50); }
.nav-cta { min-height: 40px; padding: .5rem .9rem !important; color: white !important; }

.navbar-toggler {
  width: 40px;
  height: 40px;
  padding: .45rem;
  border-color: var(--twk-border);
  border-radius: var(--twk-radius-sm);
}
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem var(--color-primary-alpha); }

.site-footer {
  flex: 0 0 auto;
  padding: 2rem 0 1rem;
  margin-top: auto;
  border-top: 1px solid var(--twk-border);
  background: var(--twk-surface-soft);
}
.footer-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.footer-grid p { max-width: 380px; margin-top: .8rem; color: var(--twk-muted); font-size: .9rem; }
.footer-grid nav { display: grid; gap: .8rem; }
.footer-grid nav a { color: var(--twk-muted); font-size: .9rem; text-decoration: none; }
.footer-grid nav a:hover { color: var(--twk-primary-700); }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--twk-border);
  color: var(--twk-subtle);
  font-size: .8rem;
}

/* ==========================================================================
   LANDING / CONTENT PAGES
   ========================================================================== */

.landing-body { background: var(--twk-surface); }
.hero {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  background:
    radial-gradient(circle at 5% 18%, var(--color-secondary-alpha), transparent 31rem),
    radial-gradient(circle at 100% 85%, var(--color-primary-alpha), transparent 27rem),
    linear-gradient(180deg, var(--twk-surface-soft), white);
}
.hero-grid, .safety-grid { display: grid; gap: 2.5rem; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--twk-primary-700);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 720px;
  margin: 1rem 0 1.15rem;
  font-size: clamp(2.2rem, 9vw, 4rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.05em;
}
.hero h1 span { color: var(--twk-primary-600); }
.hero-copy > p { max-width: 650px; color: var(--twk-muted); font-size: 1.05rem; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: 1.6rem 0; }
.hero-actions .btn { flex: 0 1 auto; }
.trust-list { display: grid; gap: .65rem; padding: 0; margin: 0; color: var(--twk-muted); font-size: .86rem; list-style: none; }
.trust-list i { margin-right: .35rem; color: var(--twk-success); font-size: 1.3rem; vertical-align: -.15em; }
.hero-visual { position: relative; max-width: 640px; }
.profile-preview {
  overflow: hidden;
  border: 4px solid white;
  border-radius: var(--twk-radius-xl);
  background: white;
  box-shadow: var(--twk-shadow-lg);
}
.profile-preview > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.profile-caption { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; padding: 1rem; }
.profile-caption strong, .profile-caption span { display: block; }
.profile-caption strong { font-weight: 650; }
.profile-caption div span { color: var(--twk-muted); font-size: .8rem; }
.match-pill { padding: .45rem .65rem; border-radius: var(--twk-radius-round); color: var(--twk-primary-700); background: var(--twk-primary-50); font-size: .75rem; font-weight: 650; }
.floating-note {
  position: relative;
  z-index: 2;
  width: 92%;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem .9rem;
  margin: -1.1rem auto 0;
  border: 1px solid var(--twk-border);
  border-radius: var(--twk-radius-md);
  background: var(--color-white-alpha);
  box-shadow: var(--twk-shadow-md);
}
.floating-note > i { display: grid; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; place-items: center; border-radius: var(--twk-radius-sm); color: white; background: var(--twk-primary); }
.floating-note span, .floating-note strong { display: block; font-size: .75rem; }
.floating-note strong { color: var(--twk-ink); font-size: .85rem; font-weight: 650; }

.section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section-heading { max-width: 650px; margin: 0 auto 2.5rem; text-align: center; }
.section h2 { margin: .7rem 0; font-size: clamp(1.75rem, 7vw, 2.7rem); font-weight: 630; letter-spacing: -.04em; }
.feature-grid { display: grid; gap: 1rem; }
.feature-card { position: relative; padding: 1.5rem; border: 0; border-radius: var(--twk-radius-lg); background: var(--twk-surface); box-shadow: var(--twk-shadow-xs); }
.feature-card > span { position: absolute; top: 1rem; right: 1.15rem; color: var(--twk-subtle); font-size: 1.15rem; font-weight: 650; }
.feature-card > i { display: grid; width: 2.8rem; height: 2.8rem; margin-bottom: 1.2rem; place-items: center; border-radius: var(--twk-radius-md); color: var(--twk-primary-700); background: var(--twk-primary-50); font-size: 1.2rem; }
.feature-card h3 { font-size: 1.08rem; font-weight: 650; }
.feature-card p { color: var(--twk-muted); font-size: .9rem; line-height: 1.65; }
.safety-section { color: white; background: rgba(0, 0, 0, .88); }
.safety-section h2 { color: white; }
.safety-section p { color: rgba(255, 255, 255, .72); line-height: 1.7; }
.safety-section .eyebrow { color: var(--twk-primary-300); }
.text-link { color: white; font-weight: 600; text-decoration: none; }
.text-link:hover { color: var(--twk-primary-200); }
.safety-points { display: grid; gap: .75rem; }
.safety-points > div { display: flex; gap: .85rem; padding: 1rem; border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--twk-radius-md); background: rgba(255, 255, 255, .045); }
.safety-points i { color: var(--twk-primary-300); font-size: 1.3rem; }
.safety-points span, .safety-points strong { display: block; }
.safety-points span { color: rgba(255, 255, 255, .66); font-size: .86rem; }
.safety-points strong { color: white; font-weight: 600; }
.final-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; padding: 2rem; border-radius: var(--twk-radius-lg); color: white; background: var(--twk-primary); box-shadow: var(--twk-shadow-sm); }
.final-cta .eyebrow { color: rgba(255, 255, 255, .78); }
.final-cta h2 { max-width: 700px; margin-bottom: 0; color: white; }

.content-page { padding: clamp(2.5rem, 7vw, 4.5rem) 0; background: linear-gradient(180deg, var(--twk-surface-soft), white); }
.content-card { max-width: 850px; padding: 1.5rem; margin: auto; border: 0; border-radius: var(--twk-radius-xl); background: var(--twk-surface); box-shadow: var(--twk-shadow-sm); }
.content-card h1 { margin: .75rem 0 1.75rem; font-size: clamp(2rem, 9vw, 3.6rem); font-weight: 650; letter-spacing: -.045em; }
.content-card h2 { margin: 2rem 0 .7rem; font-size: 1.25rem; }
.content-card p { color: var(--twk-muted); line-height: 1.75; }
.content-card .lead { color: var(--twk-text); font-size: 1.08rem; }

/* ==========================================================================
   AUTHENTICATION
   ========================================================================== */

.auth-page, body:has(.auth-card), body:has(.fullpage) {
  background:
    radial-gradient(circle at 10% 12%, var(--color-secondary-alpha), transparent 26rem),
    radial-gradient(circle at 92% 84%, var(--color-primary-alpha), transparent 25rem),
    var(--twk-page-warm);
}
.auth-page > main,
.auth-page > section {
  display: grid;
  align-content: center;
  padding-top: 2.25rem !important;
  padding-bottom: 2.25rem !important;
}
.auth-card { max-width: 500px; margin-inline: auto; }
.auth-card > .text-center { margin-bottom: 1.5rem !important; }
.auth-card h1 { margin-top: .85rem !important; margin-bottom: .45rem; font-size: clamp(1.75rem, 7vw, 2.25rem) !important; font-weight: 650; }
.auth-card > .card, .fullpage .card { border: 0; box-shadow: var(--twk-shadow-sm) !important; }
.auth-card .card-body, .fullpage .card-body { padding: 1.35rem !important; }
.auth-card .btn-primary, .fullpage .btn-primary { margin-top: .2rem; }
.brand-badge { display: inline-flex; align-items: center; justify-content: center; color: var(--twk-primary-700); font-size: .76rem !important; font-weight: 620; letter-spacing: .01em; }
.brand-badge img { width: min(180px, 52vw); height: auto; display: block; }
.fullpage { display: flex !important; align-items: center; justify-content: center; padding-block: 2.25rem; }
.flag { width: 24px; height: 14px; border-radius: 2px; object-fit: cover; }
.auth-trust { display: flex; justify-content: center; gap: .45rem; margin-top: 1rem; color: var(--twk-muted); font-size: .78rem; }
.locale-switcher { max-width: 620px; margin-inline: auto; }
.locale-switcher .btn {
  min-height: 30px;
  padding: .25rem .45rem !important;
  border-color: transparent;
  color: var(--twk-muted);
  background: transparent;
  font-size: .72rem;
  font-weight: 500;
}
.locale-switcher .btn:hover { color: var(--twk-primary-700); background: var(--twk-primary-50); }
.password-strength { height: 6px; overflow: hidden; border-radius: var(--twk-radius-round); background: var(--twk-border); }
.password-strength .progress-bar { border-radius: inherit; transition: width var(--twk-transition); }
.otp-grid { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem !important; max-width: 350px; margin-inline: auto; }
.otp-input { width: 100% !important; height: 52px !important; min-height: 52px; padding: 0; font-size: 1.35rem !important; font-weight: 600; }
.status-icon { font-size: 2.75rem; line-height: 1; }

/* ==========================================================================
   MEMBER APP SHELL
   ========================================================================== */

.app-body, body:has(.twk-app) { background: var(--twk-page); }
.twk-app { min-height: 100vh; min-height: 100svh; display: flex; padding: 0; }
.twk-shell { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0; padding-bottom: 82px; }
.app-main, .twk-shell > main { flex: 1; padding: 1.25rem 0 2rem; }
.app-container, .twk-shell > main > .container { width: 100%; max-width: var(--twk-app-width); padding-inline: 1rem; margin-inline: auto; }

.twk-sidebar {
  position: fixed;
  right: .65rem;
  bottom: max(.65rem, env(safe-area-inset-bottom));
  left: .65rem;
  z-index: 1040;
  width: auto;
  height: 62px;
  min-height: 0;
  display: flex;
  flex-direction: row;
  padding: .4rem;
  border: 1px solid var(--twk-border);
  border-radius: var(--twk-radius-md);
  background: var(--color-white-alpha);
  box-shadow: 0 12px 38px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px) saturate(160%);
}
.twk-brand { display: none; }
.twk-nav { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: .15rem; margin: 0; }
.twk-nav .item {
  position: relative;
  min-width: 0;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .12rem;
  padding: .35rem .2rem;
  border-radius: var(--twk-radius-sm);
  color: var(--twk-muted);
  text-decoration: none;
}
.twk-nav .item:nth-child(n+6) { display: none; }
.twk-nav .item i { font-size: 1.15rem; line-height: 1; }
.twk-nav .item .text { display: block; max-width: 100%; overflow: hidden; font-size: .62rem; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.twk-nav .item:hover { color: var(--twk-primary-700); background: var(--twk-primary-50); }
.twk-nav .item.active { color: var(--twk-primary-700); background: var(--twk-primary-100); font-weight: 600; }
.twk-nav .badge { position: absolute; top: .15rem; right: .25rem; min-width: 18px; padding: .16rem .32rem; color: white; background: var(--twk-primary); font-size: .62rem; }
.twk-logout { display: none; }
.twk-logout-link { color: var(--twk-danger); }
.twk-logout-link:hover { color: var(--twk-danger); background: var(--twk-danger-soft); }

.twk-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--twk-border);
  border-radius: 0;
  background: var(--color-white-alpha);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.topbar-wordmark { flex: 0 0 auto; }
.topbar-wordmark .brand-logo-long { display: none; }
.topbar-wordmark .brand-logo-mark { display: block !important; width: 32px; height: 32px; }
.topbar-actions { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.topbar-action { width: 38px; height: 38px; display: inline-grid; flex: 0 0 auto; place-items: center; border-radius: var(--twk-radius-sm); color: var(--twk-muted); text-decoration: none; }
.topbar-action:hover { color: var(--twk-primary-700); background: var(--twk-primary-50); }
.topbar-logout { display: none; }
.topbar-user { display: none; align-items: center; gap: .5rem; color: var(--twk-muted); font-size: .82rem; }
.topbar-avatar { display: none; overflow: hidden; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.page-header { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.4rem; }
.page-header h1 { margin: 0; font-size: clamp(1.55rem, 6vw, 2.15rem); }
.page-header p { margin: 0; color: var(--twk-muted); font-size: .9rem; }

/* ==========================================================================
   PROFILE EDITOR / FORMS
   ========================================================================== */

.profile-editor { max-width: 980px; margin-inline: auto; }
.profile-editor-header { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1.25rem; }
.profile-completion { min-width: 200px; }
.profile-completion-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.profile-completion-label { display: flex; align-items: center; gap: .3rem; color: var(--twk-muted); font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.profile-completion-label .material-symbols-rounded { font-size: .95rem; }
.profile-completion-value { color: var(--twk-text); font-size: .8rem; font-weight: 650; }
.profile-progress {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: var(--twk-radius-round);
  background: var(--twk-surface-soft);
}
.profile-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--twk-primary);
  transition: width 600ms cubic-bezier(.2, .7, .2, 1);
}

.accordion { display: grid; gap: .75rem; }
.accordion-item { overflow: hidden; border: 0 !important; border-radius: var(--twk-radius-lg) !important; background: var(--twk-surface); box-shadow: var(--twk-shadow-xs); }
.accordion-button { min-height: 62px; padding: 1rem 1.1rem; color: var(--twk-ink); background: var(--twk-surface); font-size: .98rem; font-weight: 620; box-shadow: none !important; }
.accordion-button:not(.collapsed) { color: var(--twk-primary-800); background: var(--twk-primary-50); }
.accordion-button::after { width: 1rem; height: 1rem; background-size: 1rem; }
.accordion-button::before {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  flex: 0 0 auto;
  margin-right: .7rem;
  place-items: center;
  border-radius: var(--twk-radius-sm);
  color: var(--twk-primary-700);
  background: var(--twk-primary-50);
  font-family: "Material Symbols Rounded";
  font-size: 1.15rem;
  font-weight: normal;
  line-height: 1;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
#headingMe .accordion-button::before { content: "person"; }
#headingLooking .accordion-button::before { content: "favorite"; }
#headingLifestyle .accordion-button::before { content: "spa"; }
#headingWork .accordion-button::before { content: "work"; }
#headingBio .accordion-button::before { content: "edit_note"; }
#headingInterests .accordion-button::before { content: "interests"; }
#headingPhotos .accordion-button::before { content: "photo_library"; }
.accordion-body { padding: 1.15rem; }
.accordion-body .row { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.accordion-body .mb-2 { margin-bottom: 1rem !important; }
.save-orb {
  --save-orb-color: #22c55e;
  --save-orb-size: 56px;
  --save-orb-circumference: 119.4;
  position: fixed;
  z-index: 60;
  right: 1.5rem;
  bottom: 1.5rem;
  width: var(--save-orb-size);
  height: var(--save-orb-size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--twk-surface);
  box-shadow: var(--twk-shadow-lg);
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}
.save-orb.is-active { opacity: 1; transform: scale(1); transition: opacity 200ms ease, transform 300ms cubic-bezier(.34, 1.56, .64, 1); }
.save-orb.is-error { --save-orb-color: var(--twk-danger); }
.save-orb.is-leaving {
  animation: save-orb-pop 620ms cubic-bezier(.36, .07, .19, .97) forwards;
}
.save-orb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.save-orb-track, .save-orb-progress {
  fill: none;
  stroke-width: 3;
}
.save-orb-track { stroke: var(--twk-border); }
.save-orb-progress {
  stroke: var(--save-orb-color);
  stroke-linecap: round;
  stroke-dasharray: var(--save-orb-circumference);
  stroke-dashoffset: var(--save-orb-circumference);
}
.save-orb.is-filling .save-orb-progress { stroke-dashoffset: 0; transition: stroke-dashoffset 850ms ease; }
.save-orb-fill {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--save-orb-color);
  opacity: 0;
  transform: scale(.5);
  transition: opacity 260ms ease, transform 320ms cubic-bezier(.34, 1.56, .64, 1);
}
.save-orb.is-filled .save-orb-fill { opacity: 1; transform: scale(1); }
.save-orb-icon {
  position: relative;
  color: var(--save-orb-color);
  font-size: 1.35rem;
  transition: color 200ms ease;
}
.save-orb.is-filled .save-orb-icon { color: white; }
@keyframes save-orb-pop {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.22); opacity: 1; }
  65% { transform: scale(.85); opacity: .7; }
  100% { transform: scale(.3); opacity: 0; }
}
.interest-pill, .language-pill,
.looking-status-pill, .preferred-gender-pill, .relation-goal-pill { min-height: 38px; border-radius: var(--twk-radius-round) !important; font-weight: 500; }
.interest-pill.active, .language-pill.active,
.looking-status-pill.active, .preferred-gender-pill.active, .relation-goal-pill.active { border-color: var(--twk-primary-200) !important; color: var(--twk-primary-800) !important; background: var(--twk-primary-100) !important; }
.interest-pill.active::before, .language-pill.active::before,
.looking-status-pill.active::before, .preferred-gender-pill.active::before, .relation-goal-pill.active::before {
  content: "check";
  margin-right: 0;
  font-family: "Material Symbols Rounded";
  font-size: .95rem;
  line-height: 1;
  vertical-align: -.15em;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20;
}

/* Sliders double poignée (âge / distance) */
.twk-range-value { color: var(--twk-primary-700); font-size: .84rem; font-weight: 700; }
.twk-range-slider { --twk-range-track-h: 4px; --twk-range-thumb-d: 20px; position: relative; height: 2rem; margin-top: .5rem; }
.twk-range-track { position: absolute; top: 50%; right: 0; left: 0; height: var(--twk-range-track-h); margin-top: calc(var(--twk-range-track-h) / -2); border-radius: var(--twk-radius-round); background: var(--twk-border); }
.twk-range-track-fill { position: absolute; top: 0; height: 100%; border-radius: var(--twk-radius-round); background: var(--twk-primary); }

.twk-range-input {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--twk-range-thumb-d);
  margin: calc(var(--twk-range-thumb-d) / -2) 0 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.twk-range-input,
.twk-range-input:focus,
.twk-range-input:focus-visible { outline: none !important; box-shadow: none; }

/* Piste native invisible (on affiche notre propre piste par-dessous) */
.twk-range-input::-webkit-slider-runnable-track { height: var(--twk-range-track-h); background: transparent; border: 0; }
.twk-range-input::-moz-range-track { height: var(--twk-range-track-h); background: transparent; border: 0; }
.twk-range-input::-moz-focus-outer { border: 0; }

/* Poignée : centrée verticalement sur la piste, ombre douce + anneau primaire */
.twk-range-input::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  width: var(--twk-range-thumb-d);
  height: var(--twk-range-thumb-d);
  margin-top: calc((var(--twk-range-track-h) - var(--twk-range-thumb-d)) / 2);
  border: 3px solid var(--twk-surface);
  border-radius: 50%;
  background: var(--twk-primary);
  box-shadow: var(--twk-shadow-sm), 0 0 0 1px var(--twk-primary-300);
  cursor: grab;
  outline: none;
  transition: transform var(--twk-transition), box-shadow var(--twk-transition);
}
.twk-range-input::-moz-range-thumb {
  pointer-events: auto;
  width: var(--twk-range-thumb-d);
  height: var(--twk-range-thumb-d);
  border: 3px solid var(--twk-surface);
  border-radius: 50%;
  background: var(--twk-primary);
  box-shadow: var(--twk-shadow-sm), 0 0 0 1px var(--twk-primary-300);
  cursor: grab;
  outline: none;
  transition: transform var(--twk-transition), box-shadow var(--twk-transition);
}
.twk-range-input:focus::-webkit-slider-thumb,
.twk-range-input:focus-visible::-webkit-slider-thumb { outline: none; }
.twk-range-input:focus::-moz-range-thumb,
.twk-range-input:focus-visible::-moz-range-thumb { outline: none; }
.twk-range-input:hover::-webkit-slider-thumb,
.twk-range-input:focus-visible::-webkit-slider-thumb,
.twk-range-input:active::-webkit-slider-thumb {
  box-shadow: var(--twk-shadow-sm), 0 0 0 5px var(--twk-primary-100);
  transform: scale(1.08);
}
.twk-range-input:hover::-moz-range-thumb,
.twk-range-input:focus-visible::-moz-range-thumb,
.twk-range-input:active::-moz-range-thumb {
  box-shadow: var(--twk-shadow-sm), 0 0 0 5px var(--twk-primary-100);
  transform: scale(1.08);
}
.twk-range-input:active::-webkit-slider-thumb,
.twk-range-input:active::-moz-range-thumb { cursor: grabbing; }

.twk-range-input-min { z-index: 2; }
.twk-range-input-max { z-index: 1; }
.twk-range-input-min:focus, .twk-range-input-min:active { z-index: 3; }
.twk-range-input-max:focus, .twk-range-input-max:active { z-index: 3; }

/* Select personnalisé */
.twk-select { position: relative; }
.twk-select select.form-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.twk-select-trigger {
  width: 100%;
  min-height: var(--twk-control);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .75rem;
  border: 0;
  border-radius: var(--twk-radius-md);
  color: var(--twk-ink);
  background-color: var(--twk-input-bg);
  font-size: .9rem;
  text-align: left;
  transition: background-color var(--twk-transition), box-shadow var(--twk-transition);
}
.twk-select-trigger:hover { background-color: var(--twk-input-bg-hover); }
.twk-select-trigger:focus, .twk-select-trigger:focus-visible { outline: 0; background-color: var(--twk-input-bg-focus); }
.twk-select-trigger:disabled { opacity: .6; cursor: not-allowed; }
.twk-select-label { overflow: hidden; color: var(--twk-ink); text-overflow: ellipsis; white-space: nowrap; }
.twk-select-chevron { flex: 0 0 auto; color: var(--twk-muted); font-size: .8rem; transition: transform var(--twk-transition); }
.twk-select.open .twk-select-chevron { transform: rotate(180deg); }
.twk-select-menu {
  position: fixed;
  z-index: 1050;
  display: none;
  overflow-y: auto;
  max-height: 15rem;
  padding: .35rem;
  border: 1px solid var(--twk-border);
  border-radius: var(--twk-radius-md);
  background: var(--twk-surface);
  box-shadow: var(--twk-shadow-md);
}
.twk-select-menu.open { display: block; }
.twk-select-option {
  width: 100%;
  padding: .5rem .65rem;
  border: 0;
  border-radius: var(--twk-radius-sm);
  color: var(--twk-text);
  background: transparent;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
}
.twk-select-option:hover { background: var(--twk-surface-soft); }
.twk-select-option.active { color: var(--twk-primary-800); background: var(--twk-primary-50); font-weight: 600; }
.twk-select-option:disabled { color: var(--twk-subtle); cursor: not-allowed; }

.photo-section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; }
.photo-section-toolbar .form-text {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  margin: 0;
  color: var(--twk-muted);
  font-size: .8rem;
  line-height: 1.45;
}
.photo-section-toolbar .form-text .material-symbols-rounded { flex: 0 0 auto; margin-top: .1rem; color: var(--twk-subtle); font-size: 1.05rem; }

/* Grille : toutes les cases ont exactement la même taille et le même ratio carré. */
.photo-grid, #photoGrid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4rem !important;
  max-width: 680px;
}
.photo-grid.is-uploading, #photoGrid.is-uploading { opacity: .6; pointer-events: none; }

.photo-tile { position: relative; aspect-ratio: 1 / 1; cursor: grab; }
.photo-tile.has-photo {
  border-radius: var(--twk-radius-md);
  overflow: hidden;
  background: var(--twk-surface-soft);
  box-shadow: var(--twk-shadow-sm);
  transition: box-shadow 220ms ease;
}
.photo-tile.has-photo:hover { box-shadow: var(--twk-shadow-md); }
/* Photo de profil : liseré primary gras, détaché de la photo par un espace
   (outline plutôt que border, pour ne pas réduire la taille de la photo). */
#photoGrid > *:first-child.photo-tile.has-photo { outline: 3px solid var(--twk-primary); outline-offset: 5px; }
.photo-tile.dragging { opacity: .55; transform: scale(.97); }

.photo-tile-frame { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: var(--twk-surface-soft); }
.photo-tile-img { width: 100% !important; height: 100% !important; object-fit: cover; display: block; border-radius: 0 !important; -webkit-user-drag: none; user-select: none; }

/* Corbeille de suppression, coin haut-gauche de la photo */
.photo-tile-remove {
  position: absolute;
  top: .4rem;
  left: .4rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  cursor: pointer;
  transition: opacity var(--twk-transition), background-color var(--twk-transition);
}
.photo-tile-remove:hover, .photo-tile-remove:focus-visible { background: var(--twk-danger); outline: none; }

/* Badge "Profil", coin bas-droit — visible seulement sur la 1ère case. */
.photo-tile-badge {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  z-index: 2;
  display: none;
  align-items: center;
  line-height: 1;
  padding: .4rem .55rem .3rem;
  border-radius: var(--twk-radius-round);
  background: var(--twk-primary);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  box-shadow: var(--twk-shadow-sm);
  pointer-events: none;
}
#photoGrid > *:first-child .photo-tile-badge { display: inline-flex; }

/* Bouton "Privée", coin bas-droit — masqué sur la 1ère case (réservée au badge). */
.photo-private-toggle {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--twk-transition);
}
.photo-private-toggle.active { background: var(--twk-primary); }

/* Centrage fiable des icônes de police dans les badges circulaires : on
   fige le glyphe dans une boîte carrée exacte (1em × 1em, débordement
   masqué) au lieu de compter sur line-height, qui suit les métriques
   ascendant/descendant de la police — souvent asymétriques et donc
   responsables d'un décalage visuel selon le navigateur. */
.photo-tile-remove .material-symbols-rounded,
.photo-private-toggle .material-symbols-rounded {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 1rem;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
  overflow: hidden;
}
#photoGrid > *:first-child .photo-private-toggle { display: none; }

/* Cases vides : markup identique pour toutes — seule la position dans la
   grille (1ère = profil) détermine l'habillage ci-dessous, pour que ça
   reste correct même après un glisser-déposer. */
.photo-slot-empty {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--twk-border-strong);
  border-radius: var(--twk-radius-md);
  overflow: hidden;
  color: var(--twk-muted);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--twk-transition), border-color var(--twk-transition);
}
.photo-slot-empty:hover, .photo-slot-empty.dragover { border-color: var(--twk-primary-400); background: var(--twk-primary-50); }
.photo-slot-empty .photo-tile-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-slot-plus { font-size: 1.6rem; opacity: .25; }

#photoGrid > *:first-child.photo-slot-empty {
  outline: 3px solid var(--twk-primary-300);
  outline-offset: 5px;
  color: var(--twk-primary-700);
  background: var(--twk-primary-50);
}
#photoGrid > *:first-child.photo-slot-empty:hover,
#photoGrid > *:first-child.photo-slot-empty.dragover { background: var(--twk-primary-100); }
#photoGrid > *:first-child .photo-slot-plus { color: var(--twk-primary-500); font-size: 2.5rem; opacity: .3; }

/* ==========================================================================
   DISCOVERY / PROFILE CARDS / SWIPE
   ========================================================================== */

.discovery-hero { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.discovery-hero h1 { font-size: clamp(2rem, 9vw, 3.5rem); font-weight: 650; letter-spacing: -.045em; }
.discovery-actions { display: flex; flex-direction: column; gap: .65rem; justify-content: center; }
.discovery-preview-grid { max-width: 940px; margin-inline: auto; }
.discovery-preview-card:nth-child(2) .profile-card-media { background: linear-gradient(145deg, var(--twk-primary-50), var(--twk-secondary-100)); }
.discovery-preview-card:nth-child(3) .profile-card-media { background: linear-gradient(145deg, var(--twk-secondary-50), var(--twk-primary-100)); }
.discovery-preview-card .profile-card-media img { transition: transform 8s ease-out; }
.discovery-preview-card:hover .profile-card-media img { transform: scale(1.15); }
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.profile-card { position: relative; overflow: hidden; border: 0; border-radius: var(--twk-radius-lg); background: var(--twk-surface); box-shadow: var(--twk-shadow-xs); transition: transform var(--twk-transition), box-shadow var(--twk-transition); }
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--twk-shadow-md); }
.profile-card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 1 / 1; background: linear-gradient(145deg, var(--twk-secondary-50), var(--twk-secondary-100)); }
.profile-card-media-sm { aspect-ratio: 1 / 1; }
.profile-card-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(.96) brightness(.98); transition: transform 520ms cubic-bezier(.2, .7, .2, 1), filter 520ms cubic-bezier(.2, .7, .2, 1); }
.profile-card:hover .profile-card-media img { filter: saturate(1.12) contrast(1.03) brightness(1.02); transform: scale(1.11); }
.profile-card-media.is-blurred img { filter: blur(12px) brightness(.72); transform: scale(1.08); }
.profile-lock { position: absolute; top: .75rem; right: .75rem; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; color: white; background: rgba(0, 0, 0, .56); backdrop-filter: blur(8px); }
.profile-card-body { padding: .9rem; }
.profile-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.profile-card-title { min-width: 0; margin: 0; font-size: 1.05rem; font-weight: 650; }
.profile-card-meta { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; max-width: 58%; min-width: 0; margin: 0; overflow: hidden; color: var(--twk-muted); font-size: .82rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.profile-card-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .9rem; }
.match-action-pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 0 .85rem;
  border: 1px solid transparent;
  border-radius: var(--twk-radius-round);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.match-action-pill > span {
  display: flex;
  height: 34px;
  align-items: center;
  padding-top: 2px;
  line-height: 1;
}
.match-action-pill > i,
.match-action-pill > i::before {
  display: block;
  line-height: 1;
}
.match-action-pill > i { transform: translateY(1px); }
.match-action-pill-primary {
  color: white;
  background: var(--twk-primary);
}
.match-action-pill-primary:hover {
  color: white;
  background: var(--twk-primary-dark);
}
.match-action-pill-secondary {
  color: var(--twk-text);
  border-color: var(--twk-border-strong);
  background: transparent;
}
.match-action-pill-secondary:hover {
  color: var(--twk-ink);
  background: var(--twk-surface-soft);
}

.empty-state { display: grid; min-height: 220px; padding: 2rem; place-items: center; border: 1px dashed var(--twk-border-strong); border-radius: var(--twk-radius-lg); color: var(--twk-muted); background: var(--twk-surface-soft); text-align: center; }
.profile-grid > .empty-state { grid-column: 1 / -1; }
.empty-state i { display: grid; width: 52px; height: 52px; margin: 0 auto .8rem; place-items: center; border-radius: 50%; color: var(--twk-primary-700); background: var(--twk-primary-100); font-size: 1.35rem; }

.swipe-stage { max-width: 480px; margin-inline: auto; }
.swipe-card { overflow: hidden; border: 0; border-radius: var(--twk-radius-xl); box-shadow: var(--twk-shadow-lg); }
.swipe-card-media { position: relative; aspect-ratio: 1 / 1; background: linear-gradient(145deg, var(--twk-primary-100), var(--twk-secondary-100)); }
.swipe-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  --sel-x: 1;
  filter: saturate(calc(.35 + var(--sel-x) * 1.15));
  transition: filter .18s ease-out;
}
.swipe-seen-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1;
  padding: .35rem .65rem;
  border-radius: var(--twk-radius-round);
  background: color-mix(in srgb, var(--twk-text) 55%, transparent);
  color: #fff;
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .01em;
  box-shadow: var(--twk-shadow-sm);
}
.swipe-seen-badge .material-symbols-rounded { font-size: .9rem; }
.place-items-center { place-items: center; }
.swipe-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.swipe-actions form { min-width: 0; }

/* ==========================================================================
   PROFILE DETAIL
   ========================================================================== */

.profile-detail { max-width: 1180px; margin-inline: auto; }
.profile-persona-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.profile-primary-stack,
.profile-content-column {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.profile-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}
.profile-masonry-card {
  width: 100%;
  padding: 1.25rem;
  margin: 0;
  border: 0;
  border-radius: var(--twk-radius-lg);
  background: var(--twk-surface);
  box-shadow: var(--twk-shadow-xs);
}
.profile-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--twk-primary-700);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .075em;
  line-height: 1;
  text-transform: uppercase;
}
.profile-section-kicker .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  width: 1.85rem;
  height: 1.85rem;
  display: inline-grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 500;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
  transform: translateY(-1px);
  font-variation-settings:
    "FILL" 0,
    "wght" 300,
    "GRAD" 0,
    "opsz" 32;
}
.profile-masonry-card h2 { margin: .7rem 0 .75rem; font-size: 1.08rem; }
.profile-masonry-card p { color: var(--twk-muted); font-size: .9rem; line-height: 1.75; }
.profile-persona-card {
  text-align: center;
  color: white;
  background:
    radial-gradient(circle at 20% 0, rgba(255,255,255,.28), transparent 12rem),
    linear-gradient(180deg, var(--twk-primary), var(--twk-primary-dark));
  box-shadow: var(--twk-shadow-md);
}
.profile-avatar-ring {
  width: min(58vw, 178px);
  aspect-ratio: 1;
  display: grid;
  padding: 6px;
  margin: .5rem auto 1.1rem;
  place-items: center;
  border-radius: 50%;
  background: white;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .10);
}
.profile-avatar-ring img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  outline: 1px solid rgba(255, 255, 255, .92);
  outline-offset: -1px;
  object-fit: cover;
}
.profile-persona-card h1 { margin: 0; color: white; font-size: clamp(1.5rem, 6vw, 2rem); }
.profile-persona-subtitle { margin: .35rem 0 0; color: rgba(255,255,255,.96); font-size: .92rem; }
.profile-persona-role { margin-top: .2rem; color: white; font-size: .85rem; font-weight: 650; }
.profile-created-note { margin: .85rem 0 0; color: rgba(255,255,255,.78); font-size: .72rem; }
.profile-persona-actions { display: grid; gap: .55rem; justify-items: center; margin-top: 1.25rem; }
.profile-persona-actions form { width: 100%; }
.profile-persona-actions .match-action-pill { width: 100%; }
.profile-persona-card .match-action-pill-primary { color: var(--twk-primary-800); background: white; }
.profile-persona-card .match-action-pill-primary:hover { color: var(--twk-primary-800); background: rgba(255,255,255,.92); }
.profile-persona-card .match-action-pill-secondary { color: white; border-color: rgba(255,255,255,.7); background: transparent; }
.profile-persona-card .match-action-pill-secondary:hover { color: white; background: rgba(255,255,255,.14); }
.profile-report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  margin-top: .15rem;
  color: rgba(255,255,255,.82);
  font-size: .78rem;
  font-weight: 650;
  text-decoration: none;
}
.profile-report-link:hover { color: white; }
.profile-report-link-standalone {
  width: 100%;
  min-height: 38px;
  margin: -.35rem 0 0;
  color: var(--twk-muted);
}
.profile-report-link-standalone:hover { color: var(--twk-primary-700); }
.profile-report-link .material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-size: 1rem;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
  vertical-align: -.15em;
}
.profile-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-top: .85rem; }
.profile-gallery .photo-item { overflow: hidden; aspect-ratio: 1 / 1; border-radius: var(--twk-radius-md); background: var(--twk-surface-soft); }
.profile-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 520ms cubic-bezier(.2, .7, .2, 1), filter 520ms cubic-bezier(.2, .7, .2, 1); }
.profile-gallery .photo-item:hover img { filter: saturate(1.08) brightness(1.02); transform: scale(1.08); }
.profile-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.profile-chip { padding: .42rem .65rem; border-radius: var(--twk-radius-round); color: var(--twk-text); background: var(--twk-surface-soft); font-size: .8rem; }
.profile-facts { display: grid; gap: .65rem; margin: .95rem 0 0; }
.profile-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .55rem; border-bottom: 1px solid color-mix(in srgb, var(--twk-border) 70%, transparent); }
.profile-facts > div:last-child { padding-bottom: 0; border-bottom: 0; }
.profile-facts dt { color: var(--twk-ink); font-size: .82rem; font-weight: 650; }
.profile-facts dd { margin: 0; color: var(--twk-muted); font-size: .82rem; text-align: right; }
.profile-back-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: .65rem; color: var(--twk-primary-700); font-size: .86rem; font-weight: 650; text-decoration: none; }
.profile-back-link:hover { color: var(--twk-primary-800); }
.profile-action-panel { position: sticky; bottom: 80px; padding: .75rem; border: 0; border-radius: var(--twk-radius-lg); background: var(--color-white-alpha); box-shadow: var(--twk-shadow-sm); backdrop-filter: blur(14px); }

/* ==========================================================================
   SEARCH
   ========================================================================== */

.search-panel { padding: 1rem; margin-bottom: 1.5rem; }
.search-panel .row { --bs-gutter-x: .85rem; --bs-gutter-y: .85rem; }
.search-panel-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.results-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.results-summary p { margin: 0; color: var(--twk-muted); font-size: .86rem; }

/* ==========================================================================
   MESSAGING / LISTS / SETTINGS
   ========================================================================== */

.conversation-layout { display: grid; gap: 1rem; }
.conversation-list { overflow: hidden; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-lg); background: var(--twk-surface); }
.conversation-item { min-height: 68px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .7rem; border-bottom: 1px solid var(--twk-border); color: var(--twk-text); text-decoration: none; }
.conversation-item:last-child { border-bottom: 0; }
.conversation-item:hover, .conversation-item.active { color: var(--twk-ink); background: var(--twk-primary-50); }
.conversation-item img, .chat-header img { width: 42px; height: 42px; display: block; border-radius: 50%; object-fit: cover; }
.conversation-copy { min-width: 0; }
.conversation-copy strong, .conversation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { color: var(--twk-ink); font-size: .86rem; font-weight: 620; }
.conversation-copy small { margin-top: .12rem; color: var(--twk-muted); font-size: .76rem; }
.conversation-unread { min-width: 20px; height: 20px; display: grid; padding-inline: .3rem; place-items: center; border-radius: 999px; color: white; background: var(--twk-primary); font-size: .68rem; font-weight: 650; }
.conversation-empty { min-height: 180px; display: grid; padding: 1.5rem; place-items: center; align-content: center; gap: .35rem; color: var(--twk-muted); text-align: center; }
.conversation-empty i { color: var(--twk-primary-500); font-size: 1.5rem; }
.conversation-empty strong { color: var(--twk-ink); font-size: .9rem; }
.conversation-empty small { font-size: .78rem; }
.chat-panel { min-width: 0; min-height: 520px; display: flex; overflow: hidden; flex-direction: column; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-lg); background: var(--twk-surface); box-shadow: var(--twk-shadow-xs); }
.chat-header { min-height: 64px; display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-bottom: 1px solid var(--twk-border); }
.chat-header a { color: var(--twk-ink); text-decoration: none; }
.chat-header strong, .chat-header small { display: block; }
.chat-header strong { font-size: .88rem; font-weight: 620; }
.chat-header small { color: var(--twk-muted); font-size: .72rem; }
.chat-messages { height: 420px; flex: 1; overflow-y: auto; padding: 1rem; background: var(--twk-surface-soft); scrollbar-width: thin; }
.message-row { display: flex; margin-bottom: .65rem; }
.message-bubble { max-width: min(78%, 540px); padding: .65rem .8rem; border-radius: var(--twk-radius-md) var(--twk-radius-md) var(--twk-radius-md) var(--twk-radius-xs); color: var(--twk-text); background: var(--twk-secondary-100); font-size: .9rem; }
.message-bubble time { display: block; margin-top: .18rem; color: currentColor; font-size: .64rem; opacity: .62; text-align: right; }
.message-row.is-mine { justify-content: flex-end; }
.message-row.is-mine .message-bubble { border-radius: var(--twk-radius-md) var(--twk-radius-md) var(--twk-radius-xs) var(--twk-radius-md); color: white; background: var(--twk-primary); }
.chat-welcome { min-height: 100%; display: grid; place-items: center; align-content: center; gap: .35rem; color: var(--twk-muted); text-align: center; }
.chat-welcome i { color: var(--twk-primary-500); font-size: 1.5rem; }
.chat-welcome strong { color: var(--twk-ink); }
.chat-welcome span { font-size: .8rem; }
.chat-panel-empty { display: grid; padding: 2rem; place-items: center; text-align: center; }
.chat-panel-empty > div { max-width: 360px; }
.chat-panel-empty i { color: var(--twk-primary-500); font-size: 2rem; }
.chat-panel-empty h2 { margin: .8rem 0 .4rem; font-size: 1.15rem; }
.chat-panel-empty p { color: var(--twk-muted); font-size: .86rem; }
.message-composer { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--twk-border); background: var(--twk-surface); }
.message-composer .form-control { min-width: 0; border-radius: var(--twk-radius-round); }
.message-composer .btn { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; }

.visitor-list { overflow: hidden; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-lg); background: var(--twk-surface); }
.visitor-row { min-height: 72px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; padding: .7rem .85rem; border-bottom: 1px solid var(--twk-border); color: var(--twk-text); text-decoration: none; }
.visitor-row:last-child { border-bottom: 0; }
.visitor-row:hover { color: var(--twk-text); background: var(--twk-primary-50); }
.visitor-row img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.visitor-copy { min-width: 0; }
.visitor-copy strong, .visitor-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visitor-copy strong { color: var(--twk-ink); font-size: .88rem; font-weight: 620; }
.visitor-copy small, .visitor-row time { color: var(--twk-muted); font-size: .76rem; }
.visitor-row > i { color: var(--twk-subtle); font-size: .8rem; }

.settings-card { padding: 1.25rem; }
.settings-section + .settings-section { padding-top: 1.25rem; margin-top: 1.25rem; border-top: 1px solid var(--twk-border); }
.settings-section h2 { margin-bottom: .9rem; font-size: 1.05rem; }
.wallet-balance { color: var(--twk-ink); font-size: clamp(2rem, 8vw, 3rem); font-weight: 620; letter-spacing: -.045em; line-height: 1.1; }
.wallet-balance small { color: var(--twk-muted); font-size: .9rem; font-weight: 500; letter-spacing: 0; }
.list-group-item { border-color: var(--twk-border); }

/* ==========================================================================
   PHOTO LEGACY COMPATIBILITY
   ========================================================================== */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.tile-grid { display: flex; flex-wrap: wrap; gap: .65rem; }
.tile { position: relative; overflow: hidden; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-md); background: var(--twk-surface-soft); cursor: grab; }
.tile img { width: 190px; height: 190px; display: block; object-fit: cover; user-select: none; }
.photo-thumbnail { width: 200px; height: 200px; display: block; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-md); object-fit: cover; }
.tile .bar { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; gap: .4rem; padding: .5rem; background: linear-gradient(transparent, rgba(0,0,0,.62)); }
.tile .bar button { padding: .3rem .55rem; border: 0; border-radius: var(--twk-radius-round); background: rgba(255,255,255,.94); font-size: .75rem; }
.tile .badge, .tile .lock { position: absolute; top: .45rem; padding: .25rem .5rem; border-radius: var(--twk-radius-round); color: white; font-size: .7rem; }
.tile .badge { left: .45rem; background: var(--twk-primary); }
.tile .lock { right: .45rem; background: rgba(0, 0, 0, .78); }
.tile.dragging { opacity: .55; transform: scale(.97); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (min-width: 576px) {
  .container { width: min(calc(100% - 3rem), var(--twk-content-width)); }
  .card-body { padding: 1.5rem; }
  .hero-actions, .discovery-actions { display: flex; flex-wrap: wrap; }
  .trust-list { display: flex; flex-wrap: wrap; gap: .75rem 1.3rem; }
  .profile-caption { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .footer-grid { flex-direction: row; justify-content: space-between; }
  .footer-grid nav { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 1rem 1.25rem; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .final-cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 3rem; }
  .content-card { padding: 3rem; }
  .auth-card .card-body, .fullpage .card-body { padding: 2rem !important; }
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .matches-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .profile-persona-layout { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); align-items: start; }
  .profile-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conversation-layout { grid-template-columns: minmax(250px, .38fr) minmax(0, 1fr); }
  .search-panel { padding: 1.25rem; }
  .app-container, .twk-shell > main > .container { padding-inline: 1.5rem; }
}

@media (min-width: 992px) {
  .site-nav .navbar-nav { gap: .15rem; }
  .hero { padding: 5.5rem 0; }
  .hero-grid, .safety-grid { grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); gap: clamp(3rem, 6vw, 6rem); }
  .profile-preview { border-width: 5px; }
  .floating-note { position: absolute; right: -1rem; bottom: 14%; width: auto; margin: 0; }
  .section { padding: 6rem 0; }
  .twk-app { gap: 0; }
  .twk-shell { margin-left: 238px; padding-bottom: 0; }
  .twk-sidebar {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: 238px;
    height: 100vh;
    flex-direction: column;
    padding: 1rem;
    border: 0;
    border-right: 1px solid var(--twk-border);
    border-radius: 0;
    background: var(--twk-surface);
    box-shadow: none;
    backdrop-filter: none;
  }
  .twk-brand { min-height: 58px; display: flex; justify-content: flex-start; padding: .55rem .5rem; border: 0; }
  .sidebar-wordmark { width: 100%; }
  .sidebar-wordmark .brand-logo-long { width: 150px; height: auto; }
  .twk-nav { display: flex; flex: 1; flex-direction: column; gap: .25rem; margin-top: 1.25rem; }
  .twk-nav .item, .twk-nav .item:nth-child(n+6) { min-height: 46px; display: flex; flex-direction: row; justify-content: flex-start; gap: .75rem; padding: .65rem .75rem; }
  .twk-nav .item i { width: 20px; font-size: 1rem; text-align: center; }
  .twk-nav .item .text { font-size: .88rem; }
  .twk-nav .badge { position: static; margin-left: auto; }
  .twk-logout { display: block; margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--twk-border); }
  .twk-logout .item { min-height: 44px; display: flex; align-items: center; justify-content: flex-start; gap: .75rem; padding: .6rem .75rem; border-radius: var(--twk-radius-sm); text-decoration: none; }
  .twk-topbar { min-height: 68px; padding: .7rem 1.5rem; background: var(--color-white-alpha); }
  .topbar-wordmark { display: none; }
  .topbar-logout { display: inline-grid; }
  .topbar-user { display: flex; }
  .topbar-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--twk-primary); }
  .app-main, .twk-shell > main { padding: 2rem 0 3rem; }
  .profile-editor-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .save-orb { bottom: 1rem; }
  .profile-action-panel { bottom: 1rem; }
  .profile-persona-layout { grid-template-columns: minmax(300px, 368px) minmax(0, 1fr); align-items: start; }
  .profile-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .site-nav .navbar-collapse {
    padding: .75rem 0 .25rem;
    margin-top: .55rem;
    border-top: 1px solid var(--twk-border);
  }
  .site-nav .navbar-nav { align-items: stretch !important; gap: .2rem; }
  .site-nav .nav-cta { width: 100%; margin-top: .25rem; }
}

@media (max-width: 767.98px) {
  .conversation-list {
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    padding: .1rem 0 .45rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .conversation-list::-webkit-scrollbar { display: none; }
  .conversation-item {
    min-width: min(78vw, 270px);
    border: 1px solid var(--twk-border);
    border-radius: var(--twk-radius-md);
    background: var(--twk-surface);
    scroll-snap-align: start;
  }
  .conversation-item:last-child { border-bottom: 1px solid var(--twk-border); }
  .conversation-empty { width: 100%; border: 1px solid var(--twk-border); border-radius: var(--twk-radius-md); background: var(--twk-surface); }
  .chat-panel { min-height: calc(100svh - 235px); }
}

@media (max-width: 575.98px) {
  .site-nav .navbar-brand .brand-logo-long { display: none; }
  .site-nav .navbar-brand .brand-logo-mark { display: block !important; }
  .hero-actions .btn, .discovery-actions .btn { width: 100%; }
  .search-panel-actions .btn { flex: 1 1 100%; }
  .profile-card-actions > .small { display: none; }
  .profile-card-actions .btn:only-child { margin-left: auto; }
  .visitor-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .visitor-row img { width: 42px; height: 42px; }
  .visitor-row time { display: none; }
  .photo-section-toolbar { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 1200px) {
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .matches-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (hover: none) {
  .btn:hover, .profile-card:hover { transform: none; }
}

/* =============================
   Upsell / limites de plan
   ============================= */
.upsell-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: var(--twk-radius-lg);
  background: linear-gradient(120deg, var(--twk-primary-50), var(--twk-secondary-50));
  border: 1px solid var(--twk-primary-100);
}
.upsell-banner i { margin-right: .4rem; color: var(--twk-primary-700); }
.upsell-banner p { color: var(--twk-muted); font-size: .85rem; }
.upsell-banner .btn { flex-shrink: 0; }

.visitor-row-locked { cursor: default; }
.visitor-photo-blurred { filter: blur(6px) brightness(.85); }
.blurred-text { color: transparent; background: var(--twk-border-strong); border-radius: .3em; user-select: none; }
.visitor-row-locked i { color: var(--twk-subtle); }

/* =============================
   Page Abonnement (pricing)
   ============================= */
.plans-hero { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.plans-hero .eyebrow { justify-content: center; }

.plans-grid {
  display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1.6rem 1.4rem; border-radius: var(--twk-radius-xl);
  background: var(--twk-surface); border: 1px solid var(--twk-border);
  box-shadow: var(--twk-shadow-xs);
  opacity: 0; transform: translateY(18px);
  animation: plan-card-in 560ms cubic-bezier(.2,.7,.2,1) forwards;
  transition: transform var(--twk-transition), box-shadow var(--twk-transition), border-color var(--twk-transition);
}
.plan-card:nth-child(1) { animation-delay: 40ms; }
.plan-card:nth-child(2) { animation-delay: 140ms; }
.plan-card:nth-child(3) { animation-delay: 240ms; }
.plan-card:hover { transform: translateY(-6px); box-shadow: var(--twk-shadow-md); }

.plan-card.is-current { border-color: var(--twk-primary-300); box-shadow: 0 0 0 3px var(--twk-primary-50); }
.plan-card.is-featured { border-color: var(--twk-primary-300); background: linear-gradient(160deg, var(--twk-surface), var(--twk-primary-50)); }
.plan-card.is-featured::before {
  content: "Le plus populaire"; position: absolute; top: -.6rem; left: 50%; transform: translateX(-50%);
  padding: .3rem .75rem; border-radius: var(--twk-radius-round); background: var(--twk-primary); color: #fff;
  font-size: .68rem; font-weight: 650; letter-spacing: .02em; box-shadow: var(--twk-shadow-sm);
}

.plan-card-name { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.plan-card-name h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.plan-card-price { display: flex; align-items: baseline; gap: .3rem; }
.plan-card-price .amount { font-size: 2.1rem; font-weight: 680; letter-spacing: -.03em; color: var(--twk-ink); }
.plan-card-price .amount .cents { font-size: 1.1rem; }
.plan-card-price .period { color: var(--twk-muted); font-size: .85rem; }
.plan-card-tagline { margin: -.4rem 0 0; color: var(--twk-muted); font-size: .85rem; }

.plan-card-features { display: flex; flex-direction: column; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.plan-card-features li { display: flex; align-items: flex-start; gap: .55rem; font-size: .87rem; color: var(--twk-text); }
.plan-card-features li i { margin-top: .15rem; color: var(--twk-primary-700); flex-shrink: 0; }

.plan-card-cta { margin-top: auto; }
.plan-card-cta .btn { width: 100%; }
.plan-badge-current { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: var(--twk-radius-round); background: var(--twk-primary-100); color: var(--twk-primary-800); font-size: .72rem; font-weight: 650; }
.plan-badge-soon { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: var(--twk-radius-round); background: var(--twk-surface-soft); color: var(--twk-subtle); font-size: .72rem; font-weight: 650; }

.plan-usage-card { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.plan-usage-item { padding: .9rem 1rem; border-radius: var(--twk-radius-lg); background: var(--twk-surface-soft); }
.plan-usage-item .label { display: block; margin-bottom: .35rem; color: var(--twk-muted); font-size: .78rem; }
.plan-usage-item .value { font-size: 1.3rem; font-weight: 650; color: var(--twk-ink); }
.plan-usage-bar { position: relative; height: 6px; margin-top: .5rem; border-radius: var(--twk-radius-round); background: var(--twk-border); overflow: hidden; }
.plan-usage-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--twk-primary); transition: width 480ms cubic-bezier(.2,.7,.2,1); }

@keyframes plan-card-in { to { opacity: 1; transform: translateY(0); } }

@media (hover: none) {
  .plan-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
