
/* =========================================================
   JONCORP CONTROL
   Feuille de style principale
   Thèmes : sombre et clair
   ========================================================= */

/* 1. VARIABLES DU THÈME SOMBRE */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #080e19;
  --surface: #101a2a;
  --surface-alt: #152238;
  --surface-hover: #1a2b43;

  --text: #f1f5fb;
  --text-secondary: #a2b1c5;
  --text-muted: #7789a3;

  --primary: #39c6ef;
  --primary-hover: #63d6f5;
  --primary-soft: rgba(57, 198, 239, 0.12);

  --border: #26354a;
  --input-bg: #0b1423;

  --success: #35d39a;
  --danger: #ff6b78;
  --warning: #f4bd50;

  --shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  --overlay: rgba(3, 9, 18, 0.7);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

/* 2. VARIABLES DU THÈME CLAIR */

[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #f0f5fa;
  --surface-hover: #e6eef6;

  --text: #152238;
  --text-secondary: #50627a;
  --text-muted: #73839a;

  --primary: #078db8;
  --primary-hover: #06779c;
  --primary-soft: rgba(7, 141, 184, 0.10);

  --border: #dce5ef;
  --input-bg: #ffffff;

  --success: #11845e;
  --danger: #d9364d;
  --warning: #a96c00;

  --shadow: 0 24px 70px rgba(31, 54, 82, 0.10);
  --overlay: rgba(20, 35, 55, 0.35);
}

/* 3. RÉINITIALISATION */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size: 14px;
  line-height: 1.6;

  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

/* 4. STRUCTURE GÉNÉRALE */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 82px;
  padding: 16px 6.5%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* 5. LOGO ET IDENTITÉ */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-logo {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  letter-spacing: 1.5px;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand-text span {
  margin-top: 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
}

/* 6. BOUTON DE CHANGEMENT DE THÈME */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 42px;
  padding: 9px 14px;

  color: var(--text-secondary);
  background: var(--surface-alt);

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--primary);
}

.theme-icon {
  flex-shrink: 0;
}

/* 7. MISE EN PAGE PRINCIPALE */

.auth-layout {
  width: min(1250px, 87%);
  flex: 1;

  margin: 0 auto;
  padding: 64px 0;

  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(42px, 7vw, 100px);
}

/* 8. PANNEAU DE PRÉSENTATION */

.intro-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-content {
  max-width: 570px;
}

.eyebrow {
  display: inline-block;

  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1.5;
}

.intro-panel h1 {
  max-width: 560px;
  margin-top: 22px;

  font-size: clamp(36px, 4.1vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -2px;
}

.intro-panel h1 span {
  display: block;
  margin-top: 8px;
  color: var(--primary);
}

.intro-description {
  max-width: 510px;
  margin-top: 24px;

  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.9;
}

/* 9. LISTE DES AVANTAGES */

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-top: 42px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--primary);
  background: var(--primary-soft);

  border: 1px solid var(--border);
  border-radius: 12px;
}

.feature-item h3 {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

.feature-item p {
  max-width: 390px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.intro-footer {
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* 10. PANNEAU D'AUTHENTIFICATION */

.auth-panel {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 470px;
  padding: clamp(24px, 4vw, 38px);

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);

  box-shadow: var(--shadow);
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-heading h2 {
  margin-top: 12px;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.auth-heading p {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 11. ONGLETS CONNEXION / INSCRIPTION */

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;

  padding: 5px;
  margin-bottom: 26px;

  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.auth-tab {
  min-height: 42px;
  padding: 9px 8px;

  color: var(--text-secondary);
  background: transparent;

  border: 0;
  border-radius: 7px;

  font-size: 13px;
  font-weight: 600;
  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  color: var(--text);
  background: var(--surface-alt);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 12. FORMULAIRES */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.form-group input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;

  color: var(--text);
  background: var(--input-bg);

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.form-group input:hover {
  border-color: var(--text-muted);
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-group small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.6;
}

/* 13. OPTIONS DE CONNEXION */

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: -4px;

  font-size: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input,
.consent-item input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;

  accent-color: var(--primary);
  cursor: pointer;
}

.form-options a,
.form-switch button {
  font-size: 12px;
  font-weight: 650;
}

/* 14. BOUTON PRINCIPAL */

.primary-button {
  width: 100%;
  min-height: 49px;
  padding: 12px 16px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  color: #06202b;
  background: var(--primary);

  border: 1px solid transparent;
  border-radius: var(--radius-sm);

  font-size: 13px;
  font-weight: 800;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.primary-button:hover {
  color: #06202b;
  background: var(--primary-hover);
  box-shadow: 0 7px 22px var(--primary-soft);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button svg {
  flex-shrink: 0;
}

/* 15. PASSAGE ENTRE LES FORMULAIRES */

.form-switch {
  margin-top: -5px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 12px;
}

.form-switch button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.form-switch button:hover {
  text-decoration: underline;
}

/* 16. ACCEPTATION DES DOCUMENTS JURIDIQUES */

.legal-consent {
  display: flex;
  flex-direction: column;
  gap: 15px;

  padding: 16px;

  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.8;

  cursor: pointer;
}

.consent-item input {
  margin-top: 4px;
}

.consent-item span {
  min-width: 0;
}

.consent-item a {
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 17. INFORMATION SUR L'ESSAI GRATUIT */

.trial-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;

  padding: 14px 15px;

  color: var(--text-secondary);
  background: var(--primary-soft);

  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);

  font-size: 12px;
  line-height: 1.7;
}

.trial-notice strong {
  color: var(--text);
  font-size: 13px;
}

/* 18. MESSAGES DU FORMULAIRE */

.form-message {
  margin-bottom: 20px;
  padding: 12px 14px;

  border: 1px solid var(--border);
  border-radius: var(--radius-sm);

  color: var(--text);
  background: var(--surface-alt);

  font-size: 12px;
  line-height: 1.7;
}

.form-message.success {
  color: var(--success);
  border-color: var(--success);
}

.form-message.error {
  color: var(--danger);
  border-color: var(--danger);
}

/* 19. INDICATION DE SÉCURITÉ */

.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin-top: 28px;
  padding-top: 20px;

  color: var(--text-muted);
  border-top: 1px solid var(--border);

  font-size: 11px;
}

.security-note svg {
  flex-shrink: 0;
  color: var(--success);
}

/* 20. PIED DE PAGE ET LIENS JURIDIQUES */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;

  padding: 23px 6.5%;

  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);

  font-size: 11px;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--primary);
}

/* 21. RESPONSIVE : TABLETTES */

@media (max-width: 1000px) {
  .auth-layout {
    width: 90%;
    gap: 35px;
    padding: 48px 0;
  }

  .intro-panel h1 {
    font-size: clamp(34px, 4.5vw, 46px);
  }

  .auth-card {
    padding: 25px;
  }
}

/* 22. RESPONSIVE : MOBILES */

@media (max-width: 760px) {
  .topbar {
    min-height: 72px;
    padding: 13px 5%;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-text strong {
    font-size: 15px;
  }

  .brand-text span {
    font-size: 10px;
  }

  .theme-toggle {
    width: 42px;
    min-width: 42px;
    padding: 9px;
  }

  .theme-toggle #theme-label {
    display: none;
  }

  .auth-layout {
    width: min(520px, 90%);
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    padding: 40px 0;
  }

  .intro-panel h1 {
    margin-top: 16px;
    font-size: clamp(34px, 8vw, 46px);
    letter-spacing: -1.4px;
  }

  .intro-description {
    margin-top: 17px;
    font-size: 14px;
  }

  .feature-list {
    gap: 20px;
    margin-top: 28px;
  }

  .intro-footer {
    margin-top: 25px;
  }

  .auth-card {
    max-width: none;
    padding: clamp(22px, 6vw, 32px);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 5%;
  }

  .footer-links {
    justify-content: flex-start;
    gap: 12px 18px;
  }
}

/* 23. PETITS ÉCRANS */

@media (max-width: 380px) {
  .brand {
    gap: 8px;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .brand-text span {
    font-size: 9px;
    letter-spacing: 2px;
  }

  .auth-layout {
    width: 92%;
  }

  .auth-card {
    padding: 19px;
  }

  .auth-tabs {
    gap: 3px;
  }

  .auth-tab {
    font-size: 12px;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* 24. ACCESSIBILITÉ : MOUVEMENTS RÉDUITS */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
