/* ========== LOGIN PAGE ========== */
#login { 
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6vh;
  width: 100%;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  background: #F4F4F4;
}

[data-theme="dark"] #login {
  background: #222222;
}

.login-left {
  display: contents;
}

/* Carte — même langage que sconf-modal / settings */
.login-panel {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vh, 40px);
  padding: clamp(40px, 5vh, 52px) clamp(32px, 4vw, 48px);
  background: var(--bg-primary);
  border: none;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
  flex-shrink: 0;
  margin: 0 auto;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .login-panel {
  background: #282828;
  border: none;
  box-shadow: none;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.5vh, 16px);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  padding: 0;
}

.login-wrap { 
  width: 100%;
  max-width: none; 
  display: grid; 
  gap: clamp(22px, 2.8vh, 28px);
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: visible;
  padding-top: 0;
}

/* Logo SVG */
.logo-svg {
  width: clamp(52px, 6vw, 60px);
  height: clamp(52px, 6vw, 60px);
  margin: 0;
  display: block;
  flex-shrink: 0;
}

/* Welcome Title */
.welcome-title {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  margin-bottom: clamp(4px, 0.5vh, 8px);
  font-family: 'Satoshi', sans-serif;
  flex-shrink: 0;
  transition: color 0.3s ease;
  letter-spacing: -0.02em;
}

/* Scale up pour grands écrans */
@media (min-width: 1600px) {
  .login-left {
    padding: 40px;
  }

  .login-panel {
    max-width: 540px;
    padding: 52px 48px;
    gap: 40px;
  }
  
  .login-header {
    gap: 18px;
  }
  
  .logo-svg {
    width: 64px;
    height: 64px;
  }
  
  .welcome-title {
    font-size: 44px;
    margin-bottom: 8px;
  }
  
  .welcome-subtitle {
    font-size: 22px;
    gap: 10px;
  }
  
  .carousel-words {
    min-width: 5.5ch;
    height: 1.4em;
  }
  
  .login-wrap {
    gap: 24px;
  }
  
  .input-group input {
    padding: 14px 12px;
    font-size: 16px;
  }
  
  .input-group label {
    font-size: 16px;
    top: calc(14px + 6px);
  }
  
  .input-group input:focus ~ label,
  .input-group input:not(:placeholder-shown) ~ label {
    font-size: 12px;
    top: 0;
  }
  
  .btn-login {
    padding: 16px;
    font-size: 16px;
    border-radius: 0;
  }
  
  .toggle-auth {
    font-size: 14px;
  }
  
  .error-message,
  .success-message {
    font-size: 14px;
  }
  
  .forgot-password-link {
    font-size: 14px;
  }
}

/* Scale up encore plus pour très grands écrans */
@media (min-width: 1920px) {
  .login-panel {
    max-width: 580px;
    padding: 56px 52px;
    gap: 44px;
  }
  
  .login-header {
    gap: 20px;
  }
  
  .logo-svg {
    width: 68px;
    height: 68px;
  }
  
  .welcome-title {
    font-size: 48px;
    margin-bottom: 10px;
  }
  
  .welcome-subtitle {
    font-size: 24px;
    gap: 12px;
  }
  
  .carousel-words {
    min-width: 5.5ch;
  }
  
  .login-wrap {
    gap: 26px;
  }
  
  .input-group input {
    padding: 15px 14px;
    font-size: 17px;
  }
  
  .input-group label {
    font-size: 17px;
    top: calc(15px + 6px);
  }
  
  .input-group input:focus ~ label,
  .input-group input:not(:placeholder-shown) ~ label {
    font-size: 12px;
    top: 0;
  }
  
  .btn-login {
    padding: 17px;
    font-size: 17px;
    border-radius: 0;
  }
  
  .toggle-auth {
    font-size: 15px;
  }
  
  .error-message,
  .success-message {
    font-size: 15px;
  }
  
  .forgot-password-link {
    font-size: 15px;
  }
}

/* Dark mode pour welcome-title */
[data-theme="dark"] .welcome-title {
  color: var(--text-primary);
}

/* Welcome Subtitle */
.welcome-subtitle {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
  font-family: 'Satoshi', sans-serif;
  flex-shrink: 0;
  transition: color 0.3s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  letter-spacing: 0.02em;
  width: 100%;
}

/* Dark mode pour welcome-subtitle */
[data-theme="dark"] .welcome-subtitle {
  color: var(--text-secondary);
}

/* Carousel de mots */
.carousel-words {
  display: inline-block;
  position: relative;
  height: 1.3em;
  overflow: hidden;
  vertical-align: bottom;
  min-width: 5.5ch;
  text-align: left;
}

.carousel-word {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  text-align: left;
  color: #667eea;
  font-weight: 500;
  animation: carousel-slide 9s infinite;
  opacity: 0;
}

[data-theme="dark"] .carousel-word {
  color: #9BA8F5;
}

.carousel-word:nth-child(1) {
  animation-delay: 0s;
}

.carousel-word:nth-child(2) {
  animation-delay: 3s;
}

.carousel-word:nth-child(3) {
  animation-delay: 6s;
}

@keyframes carousel-slide {
  0% {
    opacity: 0;
    transform: translateY(100%);
  }
  5% {
    opacity: 1;
    transform: translateY(0);
  }
  27% {
    opacity: 1;
    transform: translateY(0);
  }
  33% {
    opacity: 0;
    transform: translateY(-100%);
  }
  100% {
    opacity: 0;
    transform: translateY(-100%);
  }
}

/* Social Login Buttons */
.social-login-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  justify-content: center;
  flex-shrink: 0;
}

.social-btn {
  width: clamp(40px, 5vw, 48px);
  height: clamp(40px, 5vw, 48px);
  border-radius: 50%;
  border: 2px solid #D9D9D9;
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
  padding: 0;
  outline: none;
  flex-shrink: 0;
}

.social-btn:hover {
  border-color: #000;
}

.social-btn:active {
  border-color: #000;
  opacity: 0.8;
}

.social-btn svg {
  width: clamp(16px, 2vw, 18px);
  height: clamp(16px, 2vw, 18px);
}



/* ========== INPUT FIELDS ========== */
.input-group { 
  position: relative;
  flex-shrink: 0;
  padding-top: 6px;
}

.input-group input {
  width: 100%;
  padding: clamp(13px, 1.8vh, 15px) 14px;
  font-size: clamp(15px, 1.9vw, 16px);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.3s ease, box-shadow 0.2s ease;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
}

.input-group input::placeholder {
  color: transparent;
}

.input-group input:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--hover-overlay);
}

[data-theme="dark"] .input-group input {
  background: #282828;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .input-group input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.input-group label {
  position: absolute; 
  left: 12px; 
  top: calc(clamp(13px, 1.8vh, 15px) + 6px);
  color: var(--text-tertiary); 
  font-size: clamp(15px, 1.9vw, 16px); 
  pointer-events: none;
  z-index: 1;
  line-height: 1;
  transition: font-size 0.2s ease, top 0.2s ease, color 0.2s ease, background-color 0.2s ease, padding 0.2s ease;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: 0;
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 0 4px;
}

[data-theme="dark"] .input-group input:focus ~ label,
[data-theme="dark"] .input-group input:not(:placeholder-shown) ~ label {
  background: #282828;
}

/* ========== PASSWORD TOGGLE ========== */
.password-toggle {
  position: absolute;
  right: 10px;
  top: auto;
  bottom: clamp(12px, 1.6vh, 14px);
  transform: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-tertiary);
  line-height: 0;
  transition: color 0.2s ease;
}

.password-toggle:hover,
.password-toggle.active {
  color: var(--text-primary);
}

[data-theme="dark"] .password-toggle {
  color: var(--text-tertiary);
}

[data-theme="dark"] .password-toggle:hover,
[data-theme="dark"] .password-toggle.active {
  color: var(--text-primary);
}

#passwordGroup input {
  padding-right: 40px;
}

/* ========== LOGIN BUTTON ========== */
.btn-login {
  width: 100%;
  padding: clamp(14px, 2vh, 16px);
  border: 1px solid var(--text-primary);
  border-radius: 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  background: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: none;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(15px, 1.9vw, 16px);
  flex-shrink: 0;
}

.btn-login:hover,
.btn-login:active {
  opacity: 0.88;
  box-shadow: none;
}

[data-theme='dark'] .btn-login {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: none;
}

[data-theme='dark'] .btn-login:hover,
[data-theme='dark'] .btn-login:active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.40);
  color: #ffffff;
  opacity: 1;
  box-shadow: none;
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========== MESSAGES ========== */
.error-message {
  color: #ff4444;
  font-size: 14px;
  text-align: center;
  margin-top: -10px;
}

.error-message .login-error-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.success-message {
  color: #4CAF50;
  font-size: 14px;
  text-align: center;
  margin-top: -10px;
}

/* ========== TOGGLE AUTH ========== */
.toggle-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  text-align: center;
  color: var(--text-secondary);
  font-size: clamp(13px, 1.6vw, 14px);
  flex-shrink: 0;
  transition: color 0.3s ease;
  padding-top: 6px;
}

/* Dark mode pour toggle-auth */
[data-theme="dark"] .toggle-auth {
  color: var(--text-secondary);
}

.toggle-auth a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

/* Dark mode pour toggle-auth a */
[data-theme="dark"] .toggle-auth a {
  color: var(--text-primary);
}

.toggle-auth a:hover {
  text-decoration: underline;
}

/* ========== TERMS & CONDITIONS ========== */
.terms-group {
  flex-shrink: 0;
}

.terms-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  font-family: 'Satoshi', sans-serif;
  line-height: 1.4;
  user-select: none;
}

[data-theme="dark"] .terms-label {
  color: var(--text-secondary);
}

.terms-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.terms-checkbox-box {
  flex-shrink: 0;
  order: 2;
  width: 20px;
  height: 20px;
  margin-top: 0;
  border: 1.5px solid #c8c8c8;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.terms-checkbox-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #667eea;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.terms-checkbox:focus-visible ~ .terms-checkbox-box {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.terms-checkbox:checked ~ .terms-checkbox-box {
  background: rgba(102, 126, 234, 0.12);
  border-color: #667eea;
  box-shadow: 0 0 0 1px rgba(102, 126, 234, 0.25);
}

.terms-checkbox:checked ~ .terms-checkbox-box::after {
  transform: rotate(45deg) scale(1);
}

[data-theme="dark"] .terms-checkbox-box {
  border-color: var(--border-color-dark, #555);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .terms-checkbox:checked ~ .terms-checkbox-box {
  background: rgba(102, 126, 234, 0.2);
  border-color: #8b9cf5;
  box-shadow: 0 0 0 1px rgba(139, 156, 245, 0.35);
}

[data-theme="dark"] .terms-checkbox:checked ~ .terms-checkbox-box::after {
  border-color: #a8b8ff;
}

.terms-label:hover .terms-checkbox-box {
  border-color: #999;
}

[data-theme="dark"] .terms-label:hover .terms-checkbox-box {
  border-color: var(--text-tertiary);
}

.terms-text {
  flex: 1;
  min-width: 0;
  order: 1;
  text-align: left;
}

.terms-link {
  color: #000;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

[data-theme="dark"] .terms-link {
  color: var(--text-primary);
}

.terms-link:hover {
  color: #667eea;
}

[data-theme="dark"] .terms-link:hover {
  color: #8b9cf5;
}

/* ========== FORGOT PASSWORD LINK ========== */
.forgot-password-container {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 10px;
}

.forgot-password-link {
  color: #666;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
  font-family: 'Satoshi', sans-serif;
}

.forgot-password-link:hover {
  color: #000;
}

/* Dark mode pour forgot password link */
[data-theme="dark"] .forgot-password-link {
  color: var(--text-secondary);
}

[data-theme="dark"] .forgot-password-link:hover {
  color: var(--text-primary);
}

/* ========== LOGO SVG DARK MODE ========== */
[data-theme="dark"] .logo-svg path {
  fill: var(--text-primary);
}

/* ========== FORGOT PASSWORD MODAL ========== */
#forgotPassword {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#forgotPassword[style*="display: block"] {
  display: flex !important;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  z-index: 10;
  background: var(--bg-primary);
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  padding: 40px;
  max-width: 400px;
  width: 90%;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  box-shadow: none;
  margin: auto;
}

/* Dark mode pour modal */
[data-theme="dark"] .modal-content {
  background: var(--bg-secondary);
}

.modal-content h2 {
  margin-bottom: 10px;
  color: #000;
  transition: color 0.3s ease;
  font-family: 'Satoshi', sans-serif;
  font-weight: 700;
}

[data-theme="dark"] .modal-content h2 {
  color: var(--text-primary);
}

.modal-content p {
  color: #666;
  margin-bottom: 24px;
  font-size: 14px;
  transition: color 0.3s ease;
  font-family: 'Satoshi', sans-serif;
}

[data-theme="dark"] .modal-content p {
  color: var(--text-secondary);
}

.modal-content .btn {
  width: 100%;
  margin-top: 0;
  background: transparent;
  border: 2px solid #D9D9D9;
  color: #000;
  transition: all 0.3s ease;
  padding: 12px;
  border-radius: 0;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
}

.modal-content .btn:hover {
  background: #F5F5F5;
  border-color: #000;
}

[data-theme="dark"] .modal-content .btn {
  background: transparent;
  border-color: var(--border-color-dark);
  color: var(--text-primary);
}

[data-theme="dark"] .modal-content .btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-primary);
}

/* Inputs dans le modal — pas de margin extra, le gap du flex gère l'espacement */
.modal-content .input-group {
  margin-bottom: 0;
}

.modal-content #resetStep1,
.modal-content #resetStep2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pas de margin-top supplémentaire sur les boutons — le gap suffit */
.modal-content .btn-login {
  margin-top: 0;
}

.modal-content .error-message,
.modal-content .success-message {
  margin: 0;
  min-height: 18px;
}

/* Bouton Back — style lien discret, pas un bouton secondaire plein */
.modal-back-btn {
  background: none !important;
  border: none !important;
  padding: 4px 0 !important;
  color: #999 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer;
  text-align: center;
  width: 100%;
  font-family: 'Satoshi', 'Plus Jakarta Sans', sans-serif;
  transition: color 0.2s ease;
}

.modal-back-btn:hover {
  color: #000 !important;
}

[data-theme="dark"] .modal-back-btn {
  color: var(--text-tertiary) !important;
}

[data-theme="dark"] .modal-back-btn:hover {
  color: var(--text-primary) !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .login-left {
    padding: clamp(15px, 2.5vh, 30px);
    gap: clamp(15px, 2.5vh, 30px);
  }
}

@media (max-width: 768px) {
  #login {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }

  .login-left {
    width: 100%;
    min-height: 100%;
    padding: clamp(24px, 4vh, 36px) clamp(16px, 4vw, 24px);
    overflow: visible;
  }

  .login-panel {
    max-width: 100%;
    padding: clamp(32px, 4vh, 40px) clamp(24px, 5vw, 32px);
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .login-left {
    padding: 16px 12px;
  }

  .login-panel {
    padding: 28px 22px;
    gap: 24px;
  }
}

