* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: #ffeaf7;
  color: #3c434a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Arrière-plan avec image et flou artistique */
.bg-backdrop {
  position: fixed;
  top: -25px;
  left: -25px;
  right: -25px;
  bottom: -25px;
  background-image: url('assets/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px) brightness(0.97);
  transform: scale(1.05); /* Empêche les bords blancs dus au blur */
  z-index: -2;
  pointer-events: none;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 234, 247, 0.45); /* Teinte douce rose pour l'harmonie */
  backdrop-filter: blur(2px);
  z-index: -1;
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 32px 28px;
}

.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.logo-wrap {
  display: inline-block;
  margin-bottom: 12px;
}

.logo-img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo-fallback {
  font-family: 'Pacifico', 'Comfortaa', cursive, sans-serif;
  font-size: 32px;
  color: #ffffff;
  text-shadow: 
    -2px -2px 0 #ea6fad,
     2px -2px 0 #ea6fad,
    -2px  2px 0 #ea6fad,
     2px  2px 0 #ea6fad,
     0px  3px 8px rgba(234, 111, 173, 0.4);
  letter-spacing: 0.5px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c3338;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13px;
  color: #646970;
  line-height: 1.4;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3c434a;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field {
  width: 100%;
  font-size: 14px;
  padding: 9px 40px 9px 12px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  color: #2c3338;
  background-color: #fff;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.input-field:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: 2px solid transparent;
}

.input-field.error {
  border-color: #d63638;
  box-shadow: 0 0 0 1px #d63638;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #646970;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: #2271b1;
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Criteria checklist */
.criteria-list {
  background: #fbfbfd;
  border: 1px solid #e2e4e7;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 18px;
  font-size: 12px;
}

.criteria-title {
  font-weight: 600;
  color: #50575e;
  margin-bottom: 8px;
}

.criterion {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #646970;
  transition: color 0.2s ease;
}

.criterion:last-child {
  margin-bottom: 0;
}

.criterion-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #dcdcde;
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.criterion.valid {
  color: #008a20;
}

.criterion.valid .criterion-icon {
  background-color: #008a20;
}

/* Match indicator */
.match-hint {
  font-size: 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-hint.error {
  color: #d63638;
}

.match-hint.valid {
  color: #008a20;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  background: #2271b1;
  border: 1px solid #2271b1;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit:hover:not(:disabled) {
  background: #135e96;
  border-color: #135e96;
}

.btn-submit:disabled {
  background: #8c8f94;
  border-color: #8c8f94;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
  border-left: 4px solid;
}

.alert.error {
  display: block;
  background-color: #fcf0f1;
  border-color: #d63638;
  color: #8a1f21;
}

.alert.success {
  display: block;
  background-color: #edfaef;
  border-color: #008a20;
  color: #005a14;
}

/* Card footer links */
.card-footer {
  text-align: center;
  margin-top: 20px;
}

.card-footer a {
  color: #2271b1;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.card-footer a:hover {
  color: #0a4b78;
  text-decoration: underline;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

.loading .spinner {
  display: inline-block;
}
