/* ============================================
   SEED I.T - Input avec effet de cassure de glace
   ============================================ */

/* Variables CSS Seed I.T (obligatoires) */
:root {
  --seedit-primary: #037CFB;
  --seedit-primary-light: #4DB6FF;

  --seedit-bg-dark: #1a1a2e;
  --seedit-bg-darker: #16213e;

  --seedit-radius: 12px;
  --seedit-transition: 0.25s ease;
  --seedit-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

  /* Variables spécifiques à l'input glacé */
  --seedit-ice-color: #4DB6FF;
  --seedit-ice-color-light: #a0d9ff;
  --seedit-ice-overlay: rgba(77, 182, 255, 0.15);
  --seedit-ice-crack: rgba(200, 230, 255, 0.9);
  --seedit-ice-particle: rgba(180, 220, 255, 0.8);

  /* Variantes de couleur */
  --seedit-ice-purple: #a855f7;
  --seedit-ice-purple-light: #d8b4fe;
  --seedit-ice-green: #10b981;
  --seedit-ice-green-light: #6ee7b7;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* Gradient de fond Seed I.T (obligatoire) */
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #ffffff;
  min-height: 100vh;
  padding: 40px 20px;
  line-height: 1.6;
}

/* Conteneur principal */
.seedit-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* Titre principal */
.seedit-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--seedit-primary) 0%, var(--seedit-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

/* Sous-titre */
.seedit-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-bottom: 3rem;
}

/* Sections de démonstration */
.seedit-demo-section {
  margin-bottom: 4rem;
}

.seedit-section-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--seedit-primary-light);
  margin-bottom: 0.75rem;
}

.seedit-section-desc {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

/* ============================================
   INPUT AVEC EFFET DE GLACE
   ============================================ */

.seedit-form-group {
  margin-bottom: 2rem;
}

.seedit-ice-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--seedit-primary-light);
  margin-bottom: 0.75rem;
  letter-spacing: 0.3px;
}

/* Wrapper contenant l'input et les overlays */
.seedit-ice-input-wrapper {
  position: relative;
  width: 100%;
}

/* Input de base */
.seedit-ice-input {
  /* Positionnement */
  position: relative;
  z-index: 1;
  width: 100%;

  /* Dimensions */
  padding: 1rem 1.25rem;
  min-height: 56px;

  /* Style */
  background: rgba(3, 124, 251, 0.08);
  border: 2px solid rgba(77, 182, 255, 0.3);
  border-radius: var(--seedit-radius);

  /* Texte */
  font-size: 1rem;
  font-family: inherit;
  color: #ffffff;
  line-height: 1.5;

  /* Transitions */
  transition:
    border-color var(--seedit-transition),
    background var(--seedit-transition),
    box-shadow var(--seedit-transition);

  /* Suppression des styles par défaut */
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Placeholder */
.seedit-ice-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  transition: color var(--seedit-transition);
}

.seedit-ice-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Textarea */
.seedit-ice-input--textarea {
  resize: vertical;
  min-height: 120px;
}

.seedit-ice-input-wrapper--textarea {
  min-height: 120px;
}

/* ============================================
   OVERLAY DE GLACE
   ============================================ */

.seedit-ice-overlay {
  /* Positionnement absolu pour couvrir l'input */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;

  /* Effet de glace */
  background:
    linear-gradient(135deg,
      rgba(77, 182, 255, 0.2) 0%,
      rgba(160, 217, 255, 0.15) 50%,
      rgba(77, 182, 255, 0.1) 100%
    );
  backdrop-filter: blur(1px) brightness(1.1);
  -webkit-backdrop-filter: blur(1px) brightness(1.1);

  /* Bordure et forme */
  border-radius: var(--seedit-radius);
  border: 1px solid rgba(200, 230, 255, 0.3);

  /* Ombres internes pour profondeur */
  box-shadow:
    inset 0 2px 8px rgba(77, 182, 255, 0.25),
    inset 0 -2px 8px rgba(160, 217, 255, 0.15),
    0 2px 12px rgba(77, 182, 255, 0.2);

  /* Pointeur */
  pointer-events: none;

  /* Transition de disparition */
  opacity: 1;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

/* Texture de glace avec pseudo-éléments */
.seedit-ice-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--seedit-radius);

  /* Reflets cristallins */
  background:
    linear-gradient(45deg,
      transparent 30%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 70%
    ),
    linear-gradient(-45deg,
      transparent 30%,
      rgba(255, 255, 255, 0.05) 50%,
      transparent 70%
    );
  background-size: 200% 200%;

  /* Animation de scintillement */
  animation: seedit-ice-shimmer 3s ease-in-out infinite;
}

/* Cristaux de glace */
.seedit-ice-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--seedit-radius);

  /* Pattern de cristaux */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 50px 50px, 80px 80px, 60px 60px, 70px 70px;
  background-position: 0 0, 20px 20px, 40px 10px, 10px 40px;

  /* Animation de mouvement des cristaux */
  animation: seedit-ice-crystals 8s linear infinite;
}

/* ============================================
   SVG DES FISSURES
   ============================================ */

.seedit-ice-cracks {
  /* Positionnement */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;

  /* Forme */
  border-radius: var(--seedit-radius);
  overflow: hidden;

  /* Interactions */
  pointer-events: none;

  /* État initial */
  opacity: 0;
}

/* Chemins des fissures (générés en JS) */
.seedit-ice-crack-path {
  stroke: var(--seedit-ice-crack);
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
  filter: url(#seedit-ice-glow);

  /* Animation d'apparition */
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  opacity: 0;
}

/* ============================================
   CANVAS DES PARTICULES
   ============================================ */

.seedit-ice-particles {
  /* Positionnement */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;

  /* Forme */
  border-radius: var(--seedit-radius);

  /* Interactions */
  pointer-events: none;

  /* État initial */
  opacity: 0;
}

/* ============================================
   ÉTATS DE L'INPUT
   ============================================ */

/* Focus - La glace commence à se fissurer */
.seedit-ice-input:focus ~ .seedit-ice-overlay {
  opacity: 0.3;
  transform: scale(1.02);
}

.seedit-ice-input:focus ~ .seedit-ice-cracks {
  opacity: 1;
}

.seedit-ice-input:focus ~ .seedit-ice-particles {
  opacity: 1;
}

/* État actif (avec contenu) - La glace a disparu */
.seedit-ice-input:not(:placeholder-shown) ~ .seedit-ice-overlay {
  opacity: 0;
  transform: scale(1.05);
}

/* Hover sur le wrapper */
.seedit-ice-input-wrapper:hover .seedit-ice-input:not(:focus) {
  border-color: rgba(77, 182, 255, 0.5);
  box-shadow: 0 0 20px rgba(77, 182, 255, 0.2);
}

.seedit-ice-input-wrapper:hover .seedit-ice-overlay {
  box-shadow:
    inset 0 2px 8px rgba(77, 182, 255, 0.35),
    inset 0 -2px 8px rgba(160, 217, 255, 0.25),
    0 2px 16px rgba(77, 182, 255, 0.3);
}

/* Focus - Input dégel */
.seedit-ice-input:focus {
  border-color: var(--seedit-ice-color);
  background: rgba(3, 124, 251, 0.12);
  box-shadow:
    0 0 0 3px rgba(77, 182, 255, 0.2),
    0 4px 20px rgba(77, 182, 255, 0.3);
}

/* Accessibilité - Focus visible */
.seedit-ice-input:focus-visible {
  outline: 2px solid var(--seedit-primary);
  outline-offset: 2px;
}

/* ============================================
   VARIANTES DE COULEUR
   ============================================ */

/* Variante violette */
.seedit-ice-input-wrapper--purple {
  --seedit-ice-color: var(--seedit-ice-purple);
  --seedit-ice-color-light: var(--seedit-ice-purple-light);
  --seedit-ice-overlay: rgba(168, 85, 247, 0.15);
  --seedit-ice-crack: rgba(216, 180, 254, 0.9);
  --seedit-ice-particle: rgba(196, 160, 240, 0.8);
}

.seedit-ice-input-wrapper--purple .seedit-ice-input {
  border-color: rgba(168, 85, 247, 0.3);
}

.seedit-ice-input-wrapper--purple .seedit-ice-input:focus {
  border-color: var(--seedit-ice-purple);
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.2),
    0 4px 20px rgba(168, 85, 247, 0.3);
}

/* Variante verte */
.seedit-ice-input-wrapper--green {
  --seedit-ice-color: var(--seedit-ice-green);
  --seedit-ice-color-light: var(--seedit-ice-green-light);
  --seedit-ice-overlay: rgba(16, 185, 129, 0.15);
  --seedit-ice-crack: rgba(110, 231, 183, 0.9);
  --seedit-ice-particle: rgba(80, 210, 160, 0.8);
}

.seedit-ice-input-wrapper--green .seedit-ice-input {
  border-color: rgba(16, 185, 129, 0.3);
}

.seedit-ice-input-wrapper--green .seedit-ice-input:focus {
  border-color: var(--seedit-ice-green);
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.2),
    0 4px 20px rgba(16, 185, 129, 0.3);
}

/* ============================================
   ANIMATIONS CSS
   ============================================ */

/* Scintillement des reflets */
@keyframes seedit-ice-shimmer {
  0%, 100% {
    background-position: 0% 0%;
    opacity: 0.8;
  }
  50% {
    background-position: 100% 100%;
    opacity: 1;
  }
}

/* Mouvement des cristaux */
@keyframes seedit-ice-crystals {
  0% {
    background-position: 0 0, 20px 20px, 40px 10px, 10px 40px;
  }
  100% {
    background-position: 50px 50px, 70px 70px, 90px 60px, 60px 90px;
  }
}

/* Animation d'apparition des fissures (utilisée en JS) */
@keyframes seedit-crack-appear {
  0% {
    stroke-dashoffset: 1000;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  70% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

/* Animation de disparition des fissures */
@keyframes seedit-crack-fade-out {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ============================================
   GRILLES ET LAYOUTS
   ============================================ */

.seedit-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* ============================================
   CARTES D'INFORMATION
   ============================================ */

.seedit-info-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(77, 182, 255, 0.2);
}

.seedit-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.seedit-info-card {
  background: rgba(3, 124, 251, 0.1);
  border: 1px solid rgba(77, 182, 255, 0.3);
  border-radius: var(--seedit-radius);
  padding: 2rem;
  transition: all var(--seedit-transition);
}

.seedit-info-card:hover {
  background: rgba(3, 124, 251, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(3, 124, 251, 0.3);
}

.seedit-info-card__icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.seedit-info-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--seedit-primary-light);
  margin-bottom: 0.75rem;
}

.seedit-info-card__desc {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

/* Tablettes */
@media (max-width: 768px) {
  .seedit-title {
    font-size: 2rem;
  }

  .seedit-subtitle {
    font-size: 1rem;
  }

  .seedit-form-grid {
    grid-template-columns: 1fr;
  }

  .seedit-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Smartphones */
@media (max-width: 375px) {
  body {
    padding: 20px 15px;
  }

  .seedit-title {
    font-size: 1.75rem;
  }

  .seedit-ice-input {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

/* Préférences utilisateur : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .seedit-ice-overlay::before,
  .seedit-ice-overlay::after {
    animation: none;
  }

  .seedit-ice-particles {
    display: none;
  }
}

/* Support du mode contraste élevé */
@media (prefers-contrast: high) {
  .seedit-ice-input {
    border-width: 3px;
    border-color: var(--seedit-primary);
  }

  .seedit-ice-overlay {
    opacity: 0.5;
  }
}
