@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-primary: #0a0b0f;
    --bg-card: #12141a;
    --border: rgba(255,255,255,0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --gradient: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #3b82f6 100%);
    --gradient-glow: rgba(124, 92, 255, 0.4);
}

/* ===== BASE & HERO ANIMATIONS ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, sans-serif; background: var(--bg-primary); color: var(--text-primary); }

.cv-video-big, .cv-video-small {
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    animation: floatingOrb 8s ease-in-out infinite;
}
@keyframes floatingOrb {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
    50% { transform: translateY(-15px) rotate(1deg); opacity: 1; }
}

/* ===== MODAL ===== */
/* =========================
   MODALE (FIX CENTRAGE)
========================= */
.cv-modal {
  display: none; /* Caché par défaut */
  position: fixed;
  inset: 0; /* Prend tout l'écran */
  z-index: 9999;
  
  /* CES 3 LIGNES FONT LE CENTRAGE */
  display: none; /* Sera remplacé par 'flex' via la classe .active */
  align-items: center;     /* Centre verticalement */
  justify-content: center;  /* Centre horizontalement */
}

.cv-modal.active {
  display: flex !important; /* Active le flexbox à l'ouverture */
}

.cv-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: -1; /* Reste derrière le contenu */
}

.cv-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px; /* Largeur de ta carte */
  margin: auto;     /* Sécurité supplémentaire pour le centrage */
  padding: 20px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

.cr-card { 
    background: var(--bg-card); border-radius: 24px; padding: 30px; 
    border: 1px solid var(--border); position: relative; z-index: 10002;
}

.cr-title { text-align: center; font-size: 22px; margin-bottom: 25px; }

/* ===== FORM STRUCTURE (AIR) ===== */
.cr-form {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Ajoute de l'espace entre chaque bloc */
}

.cr-field { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; /* Espace entre le label et l'input */
}

/* ===== INPUTS & RANDOM BUTTON ALIGNMENT ===== */
.cr-input-wrap { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

/* FORCE LA HAUTEUR DES INPUTS POUR ÉVITER LE RÉTRÉCISSEMENT */
.cr-input {
    height: 44px !important;
    min-height: 44px !important; /* Sécurité anti-écrasement */
    width: 100%;
    background: #0f1117;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #fff;
    padding: 0 12px;
    flex-shrink: 0; /* Empêche le navigateur de réduire la hauteur */
}

.cr-input:focus { border-color: #6366f1; outline: none; }

/* Style du bouton Random (à droite du champ) */
.cr-input-action {
    background: #1a1d26 !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    padding: 0 15px !important;
    height: 44px; /* Alignée sur l'input */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== SWITCHES DESIGN ===== */
.cr-toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cr-toggle { 
    display: flex; justify-content: space-between; align-items: center; 
    background: #0f1117; border: 1px solid var(--border); border-radius: 12px; padding: 10px 15px; cursor: pointer; 
}
.cr-toggle input { display: none; }
.cr-check { position: relative; width: 38px; height: 20px; background: rgba(255,255,255,0.1); border-radius: 20px; transition: 0.3s; }
.cr-check::after { content: ""; position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: 0.3s; }
.cr-toggle input:checked + .cr-check { background: var(--gradient); box-shadow: 0 0 10px var(--gradient-glow); }
.cr-toggle input:checked + .cr-check::after { left: 21px; }

/* ===== DURÉE (AÉRÉE) ===== */
/* ALIGNEMENT DES SÉLECTEURS DE DURÉE */
.cr-duration {
    display: flex;
    gap: 8px;
    width: 100%;
}

.cr-select {
    flex: 1;
    height: 44px !important;
    min-height: 44px !important;
    background: #0f1117 !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    color: white !important;
    text-align: center;
    cursor: pointer;
    appearance: none; /* Nettoie le design sur mobile/navigateur */
    -webkit-appearance: none;
}

/* ESPACEMENT ENTRE LES SECTIONS */
.cr-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 5px; /* Petit espace sous chaque champ */
}

/* ===== LIEN DE CONNEXION & COPIER ===== */
.cr-preview-row { 
    display: flex; 
    gap: 8px; 
}

.cr-copy {
    background: #1a1d26 !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    padding: 0 15px !important;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

/* ===== QR CODE FIX ===== */
.cr-qr-wrap {
    display: flex !important; flex-direction: column !important; align-items: center !important;
    width: 100% !important; margin: 15px 0 !important; padding: 15px !important;
    background: rgba(255,255,255,0.03) !important; border-radius: 15px !important;
    position: relative !important; z-index: 10 !important;
}
.cr-qr { background: #fff !important; padding: 10px !important; border-radius: 10px !important; display: inline-block !important; }
.cr-qr canvas, .cr-qr img { max-width: 150px !important; height: auto !important; position: static !important; }

/* ===== BOUTON REJOINDRE (LARGEUR TOTALE) ===== */
.cr-submit {
    margin-top: 10px !important;
    width: 100% !important; /* Force toute la largeur */
    height: 54px !important; /* Plus haut pour le confort */
    border-radius: 12px !important; /* Plus carré pour matcher le design */
    border: none !important;
    background: var(--gradient) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--gradient-glow);
    transition: all 0.3s ease;
}

.cr-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--gradient-glow);
}

.cv-close-x {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.cv-close-x:hover {
  opacity: 1;
}