/* ════════════════════════════════════════════════
   VARIABLES THÈME PARAMYND
   ════════════════════════════════════════════════ */

/* Prevent ALL SVGs from going full size by default */
svg { display: inline-block; flex-shrink: 0; }

/* Flag slot — wraps both the SVG placeholder and the real img flag */
.flag-slot {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.flag-slot img {
  width: 20px !important;
  height: 14px !important;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  display: block;
}
.flag-placeholder-svg {
  width: 20px !important;
  height: 14px !important;
  min-width: 20px;
  max-width: 20px;
}

:root {
  --r: 5px;
  --black: #050507;
  --purple: #7c5cfc;
  --teal: #06d6a0;
  --white: #ffffff;
  --gray-2: rgba(255,255,255,0.5);
  --error: #ef476f;
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.7);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 133.33vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  zoom: 0.75;
}

/* ════════════════════════════════════════════════
   ARRIÈRE-PLAN ANIMÉ (BRAIN CANVAS)
   ════════════════════════════════════════════════ */
#brainCanvas {
  position: fixed; top: 0; left: 0;
  width: 133.33vw; height: 133.33vh;
  pointer-events: none; z-index: -1;
  opacity: 0;
  animation: canvasFadeIn 2s ease 0.5s forwards;
}
@keyframes canvasFadeIn { to { opacity: 1; } }

.hero-ambient {
  position: fixed; top: 0; left: 0; width: 133.33vw; height: 133.33vh; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(5,5,7,0) 30%, rgba(5,5,7,0.55) 100%),
    radial-gradient(ellipse 100% 30% at 50% 100%, rgba(5,5,7,0.8) 0%, transparent 100%);
}

/* ════════════════════════════════════════════════
   CARTE GLASSMORPHISM PREMIUM
   ════════════════════════════════════════════════ */
.demo-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  padding: 1.2rem;
  margin: 24px auto;
  animation: fadeUp 0.8s ease-out;
}

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

.demo-card {
  background: rgba(18, 18, 24, 0.45);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r);
  padding: 1.8rem 2.1rem;
  box-shadow: var(--shadow-lg), 0 0 100px rgba(124,92,252,0.12);
}

.demo-header {
  text-align: center;
  margin-bottom: 1.6rem;
}

.demo-logo {
  width: 36px; height: 36px; 
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--purple) 0%, var(--teal) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: bold; color: #fff;
  box-shadow: 0 4px 16px rgba(124,92,252,0.4);
  margin: 0 auto 0.8rem;
}

.demo-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: -0.5px;
}

.demo-subtitle {
  font-size: 0.72rem;
  color: var(--gray-2);
  margin: 0;
}

/* ════════════════════════════════════════════════
   CHAMPS DE FORMULAIRE
   ════════════════════════════════════════════════ */
.form-row {
  display: flex; gap: 0.6rem; margin-bottom: 0.8rem;
}
.form-group {
  flex: 1; display: flex; flex-direction: column; margin-bottom: 0.8rem;
}
.form-group label {
  font-size: 0.7rem; color: var(--gray-2); margin-bottom: 0.3rem; font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  transition: all 0.2s ease;
}
.form-group input::placeholder { color: rgba(255,255,255,0.2); }

/* Autofill Chrome */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover, 
.form-group input:-webkit-autofill:focus, 
.form-group input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #1a1a24 inset !important;
  -webkit-text-fill-color: white !important;
  transition: background-color 5000s ease-in-out 0s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--purple);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.2);
}

/* Validation */
.form-group input.invalid {
  border-color: var(--error) !important;
  background: rgba(239, 71, 111, 0.05) !important;
  box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.15) !important;
}
.country-picker.invalid .country-trigger {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.15) !important;
}
.phone-input-wrap.invalid input[type="tel"] {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 71, 111, 0.15) !important;
}

/* ════════════════════════════════════════════════
   COUNTRY FLAG PICKER
   ════════════════════════════════════════════════ */
.country-picker {
  position: relative;
  width: 100%;
  outline: none;
}

.country-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.country-picker:focus .country-trigger,
.country-picker.open .country-trigger {
  border-color: var(--purple);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.2);
}

.country-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
/* Placeholder globe when no country selected */
.country-flag-placeholder {
  width: 20px; height: 14px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.country-name {
  flex: 1;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  font-family: inherit;
  transition: color 0.2s;
}
.country-picker.selected .country-name {
  color: #fff;
}

.picker-arrow {
  width: 14px !important; height: 14px !important;
  min-width: 14px; min-height: 14px;
  max-width: 14px; max-height: 14px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.country-picker.open .picker-arrow {
  transform: rotate(180deg);
}

/* Dropdown — glass opaque premium */
.country-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  z-index: 1000;

  /* Glass opaque neutral dark */
  background: rgba(12, 12, 15, 0.98);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.8),
    0 0 0 1px rgba(255,255,255,0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;

  /* hidden by default */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
}
.country-picker.open .country-dropdown {
  max-height: 280px;
  opacity: 1;
  pointer-events: auto;
}

.country-search-wrap {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: transparent;
  gap: 0.45rem;
}
.search-icon {
  width: 13px !important; height: 13px !important;
  min-width: 13px; min-height: 13px;
  max-width: 13px; max-height: 13px;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
}
.country-search-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  color: #fff;
  font-size: 0.78rem;
  font-family: inherit;
  width: 100%;
  padding: 0 !important;
  caret-color: var(--purple);
  letter-spacing: 0.01em;
}
.country-search-input::placeholder { color: rgba(255,255,255,0.2); }

.country-list {
  list-style: none;
  margin: 0; padding: 0.25rem 0;
  max-height: 215px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,92,252,0.4) transparent;
}
.country-list::-webkit-scrollbar {
  width: 3px;
  background: transparent;
}
.country-list::-webkit-scrollbar-track {
  background: transparent;
}
.country-list::-webkit-scrollbar-thumb {
  background: rgba(124,92,252,0.4);
  border-radius: 99px;
}
.country-list::-webkit-scrollbar-button {
  display: none;
  height: 0;
  width: 0;
}

.country-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
  font-size: 0.77rem;
  transition: background 0.12s ease;
}
.country-list li:hover,
.country-list li.focused {
  background: rgba(255,255,255,0.06);
}
.country-list li.selected {
  background: rgba(255,255,255,0.10);
}
/* Flag image in list */
.country-list li .c-flag {
  width: 20px !important;
  height: 14px !important;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.country-list li .c-name {
  flex: 1;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-list li .c-dial { 
  font-size: 0.67rem; 
  color: rgba(255,255,255,0.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.country-list li.no-result {
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
  justify-content: center;
  pointer-events: none;
  padding: 1rem;
}

/* ════════════════════════════════════════════════
   PHONE INPUT AVEC INDICATIF
   ════════════════════════════════════════════════ */
.phone-input-wrap {
  display: flex;
  align-items: stretch;
  border-radius: var(--r);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  overflow: hidden;
  transition: all 0.2s ease;
}
.phone-input-wrap:focus-within {
  border-color: var(--purple);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(124,92,252,0.2);
}

.phone-dial-badge {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.6rem 0.5rem 0.7rem;
  border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
  white-space: nowrap;
}
.phone-dial-badge span:first-child { font-size: 1rem; }
#dialCodeText {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  min-width: 2.4rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.phone-dial-badge.has-code #dialCodeText { color: var(--teal); }

.phone-input-wrap input[type="tel"] {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.5rem 0.7rem;
  min-width: 0;
}
.phone-input-wrap input[type="tel"]:focus { outline: none; box-shadow: none; }
.phone-input-wrap input[type="tel"]::placeholder { color: rgba(255,255,255,0.2); }

/* ════════════════════════════════════════════════
   MOT DE PASSE AVEC TOGGLE
   ════════════════════════════════════════════════ */
.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-input-wrap input {
  width: 100%;
  padding-right: 2.2rem !important;
}
.pwd-toggle {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.3rem;
  cursor: pointer;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
  display: flex; align-items: center;
}
.pwd-toggle:hover { color: rgba(255,255,255,0.7); }
.pwd-toggle svg { 
  width: 15px !important; height: 15px !important;
  max-width: 15px; max-height: 15px;
}

/* ════════════════════════════════════════════════
   JAUGE MOT DE PASSE & TEXTES
   ════════════════════════════════════════════════ */
.pwd-meter-container {
  margin-top: 5px;
  display: flex;
  gap: 3px;
  height: 3px;
}
.pwd-meter-container .seg {
  flex: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  transition: background 0.3s ease;
}

#pwd-meter-bar {
  height: 100%; width: 0%; transition: all 0.3s ease; background: var(--error);
}
#pwd-meter-text {
  font-size: 0.6rem; color: rgba(255,255,255,0.5); margin-top: 2px; text-align: right; min-height: 10px;
}

.privacy-text {
  font-size: 0.6rem; color: rgba(255,255,255,0.4); margin: 1rem 0; line-height: 1.6; text-align: center;
}
.privacy-text a { color: var(--teal); text-decoration: none; }
.privacy-text a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════
   BOUTON SUBMIT PREMIUM
   ════════════════════════════════════════════════ */
.submit-btn {
  width: 100%; padding: 0.75rem;
  border-radius: var(--r); border: none;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  color: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(124,92,252,0.3);
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  position: relative; overflow: hidden;
}
.submit-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.submit-btn:hover::before { opacity: 1; }
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124,92,252,0.5);
}
.submit-btn:active { transform: translateY(0); }
.btn-arrow {
  width: 14px !important; height: 14px !important;
  min-width: 14px; min-height: 14px;
  max-width: 14px; max-height: 14px;
  transition: transform 0.3s;
}
.submit-btn:hover .btn-arrow { transform: translateX(4px); }

.back-link {
  display: block; text-align: center; margin-top: 1rem;
  font-size: 0.7rem; color: var(--gray-2); text-decoration: none; transition: color 0.2s;
}
.back-link:hover { color: #fff; }

@media (max-width: 600px) {
  .form-row { flex-direction: column; gap: 0; }
  .demo-container { padding: 1rem; margin: 20px auto; }
  .demo-card { padding: 1.5rem; }
}

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