/* ===================================
   Seed I.T - Champ Mot de Passe avec Affichage
   Variables et styles globaux
   =================================== */

:root {
  /* Variables Seed I.T officielles */
  --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 au champ password */
  --seedit-password-height: 48px;
  --seedit-password-padding: 16px;
  --seedit-password-btn-size: 40px;
  --seedit-password-border: rgba(255, 255, 255, 0.2);
  --seedit-password-bg: rgba(255, 255, 255, 0.05);
  --seedit-password-text: #ffffff;

  /* Couleurs de validation */
  --seedit-success: #10B981;
  --seedit-error: #EF4444;
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
  min-height: 100vh;
  padding: 2rem;
}

/* ===================================
   Conteneur principal de démonstration
   =================================== */

.seedit-password-demo {
  max-width: 1000px;
  margin: 0 auto;
}

.seedit-password-demo__title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  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;
}

.seedit-password-demo__description {
  text-align: center;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================================
   Sections de démonstration
   =================================== */

.seedit-password-demo__section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--seedit-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.seedit-password-demo__section--dark {
  background: rgba(0, 0, 0, 0.3);
}

.seedit-password-demo__section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--seedit-primary-light);
  text-align: center;
}

.seedit-password-demo__section-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
  text-align: center;
}

.seedit-password-demo__examples {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.seedit-password-demo__examples--column {
  flex-direction: column;
  align-items: stretch;
}

.seedit-password-demo__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 280px;
}

.seedit-password-demo__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.seedit-password-demo__hint {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.seedit-password-demo__hint--success {
  color: var(--seedit-success);
}

.seedit-password-demo__hint--error {
  color: var(--seedit-error);
}

/* ===================================
   Composant Input Password
   =================================== */

.seedit-password-input {
  /* Structure */
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;

  /* Style de base */
  background: var(--seedit-password-bg);
  border: 2px solid var(--seedit-password-border);
  border-radius: 8px;
  overflow: hidden;

  /* Effets */
  transition: border-color var(--seedit-transition), box-shadow var(--seedit-transition);
}

.seedit-password-input:focus-within {
  border-color: var(--seedit-primary-light);
  box-shadow: 0 0 0 3px rgba(77, 182, 255, 0.1);
}

/* ===================================
   Champ input
   =================================== */

.seedit-password-input__field {
  /* Structure */
  flex: 1;
  width: 100%;
  height: var(--seedit-password-height);
  padding: 0 var(--seedit-password-padding);
  padding-right: calc(var(--seedit-password-btn-size) + var(--seedit-password-padding));

  /* Style de base */
  background: transparent;
  border: none;
  color: var(--seedit-password-text);
  font-size: 1rem;
  font-weight: 400;

  /* Apparence */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* Transitions */
  transition: padding-right var(--seedit-transition);
}

.seedit-password-input__field::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.seedit-password-input__field:focus {
  outline: none;
}

.seedit-password-input__field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===================================
   Bouton toggle
   =================================== */

.seedit-password-input__toggle {
  /* Position - sert aussi de contexte pour les icônes absolues */
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);

  /* Structure */
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--seedit-password-btn-size);
  height: var(--seedit-password-btn-size);
  padding: 0;

  /* Style de base */
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;

  /* Transitions */
  transition: all var(--seedit-transition);

  /* Reset native button styles */
  font: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.seedit-password-input__toggle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.seedit-password-input__toggle:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.seedit-password-input__toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Icônes du toggle */
.seedit-password-input__icon {
  /* Position absolue pour superposer les deux icônes exactement */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Par défaut, le mot de passe est masqué, donc afficher l'icône "œil" */
.seedit-password-input__icon--hidden {
  opacity: 1;
}

.seedit-password-input__icon--visible {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

/* Quand le mot de passe est visible, inverser les icônes */
.seedit-password-input--visible .seedit-password-input__icon--hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
}

.seedit-password-input--visible .seedit-password-input__icon--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ===================================
   VARIANTE : Small
   =================================== */

.seedit-password-input--small {
  --seedit-password-height: 36px;
  --seedit-password-padding: 12px;
  --seedit-password-btn-size: 32px;
}

.seedit-password-input--small .seedit-password-input__field {
  font-size: 0.875rem;
}

/* ===================================
   VARIANTE : Large
   =================================== */

.seedit-password-input--large {
  --seedit-password-height: 56px;
  --seedit-password-padding: 20px;
  --seedit-password-btn-size: 48px;
}

.seedit-password-input--large .seedit-password-input__field {
  font-size: 1.125rem;
}

/* ===================================
   VARIANTE : Success
   =================================== */

.seedit-password-input--success {
  border-color: var(--seedit-success);
}

.seedit-password-input--success:focus-within {
  border-color: var(--seedit-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ===================================
   VARIANTE : Error
   =================================== */

.seedit-password-input--error {
  border-color: var(--seedit-error);
}

.seedit-password-input--error:focus-within {
  border-color: var(--seedit-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ===================================
   VARIANTE : Disabled
   =================================== */

.seedit-password-input--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===================================
   Formulaire de connexion
   =================================== */

.seedit-login-form {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2.5rem;
  max-width: 450px;
  margin: 0 auto;
  backdrop-filter: blur(10px);
}

.seedit-login-form__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-align: center;
}

.seedit-login-form__subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
  text-align: center;
}

.seedit-login-form__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.seedit-login-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seedit-login-form__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
}

.seedit-login-form__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  transition: all var(--seedit-transition);
}

.seedit-login-form__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.seedit-login-form__input:focus {
  outline: none;
  border-color: var(--seedit-primary-light);
  box-shadow: 0 0 0 3px rgba(77, 182, 255, 0.1);
}

.seedit-login-form__options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.seedit-login-form__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.seedit-login-form__checkbox input {
  cursor: pointer;
}

.seedit-login-form__link {
  font-size: 0.875rem;
  color: var(--seedit-primary-light);
  text-decoration: none;
  transition: color var(--seedit-transition);
}

.seedit-login-form__link:hover {
  color: var(--seedit-primary);
  text-decoration: underline;
}

.seedit-login-form__submit {
  width: 100%;
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--seedit-primary) 0%, var(--seedit-primary-light) 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--seedit-transition), box-shadow var(--seedit-transition);
}

.seedit-login-form__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(77, 182, 255, 0.4);
}

.seedit-login-form__submit:active {
  transform: translateY(0);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .seedit-password-demo__title {
    font-size: 2rem;
  }

  .seedit-password-demo__section {
    padding: 1.5rem;
  }

  .seedit-password-demo__examples {
    gap: 1.5rem;
    flex-direction: column;
  }

  .seedit-password-demo__item {
    min-width: 0;
    width: 100%;
  }

  .seedit-login-form {
    padding: 2rem;
  }
}

@media (max-width: 375px) {
  body {
    padding: 1rem;
  }

  .seedit-password-demo__title {
    font-size: 1.75rem;
  }

  .seedit-password-demo__description {
    font-size: 1rem;
  }

  .seedit-password-demo__section {
    padding: 1.25rem;
  }

  .seedit-password-input {
    --seedit-password-height: 42px;
    --seedit-password-padding: 14px;
    --seedit-password-btn-size: 36px;
  }

  .seedit-password-input__field {
    font-size: 0.9375rem;
  }

  .seedit-login-form {
    padding: 1.5rem;
  }

  .seedit-login-form__title {
    font-size: 1.5rem;
  }

  .seedit-login-form__options {
    flex-direction: column;
    align-items: flex-start;
  }
}
