/* Landing gaiA (tbmaestro × Ammco).
   landing.css reste utilisé par auth_error.html et set_password.html. */

/* ===== Couleurs ===== */
:root {
  --orange: #ff5a1f;
  --blue: #2f8bd6;
  --violet: #9b6fb0;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
[data-theme="dark"] {
  --bg: #08080a;
  --text: #f2f1ee;
  --muted: #a7a9ac;
  --faint: #6f7276;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .12);
  --surface: rgba(255, 255, 255, .03);
  --card: #121316;
  --nav-bg: rgba(20, 21, 24, .7);
  --dot: rgba(255, 255, 255, .09);
  --invert-bg: #f2f1ee;
  --invert-text: #08080a;
  --overlay: rgba(0, 0, 0, .8);
  --input-bg: rgba(255, 255, 255, .04);
}
[data-theme="light"] {
  --bg: #f7f6f3;
  --text: #121316;
  --muted: #5b5e63;
  --faint: #75787d;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .12);
  --surface: #ffffff;
  --card: #ffffff;
  --nav-bg: rgba(255, 255, 255, .75);
  --dot: rgba(0, 0, 0, .08);
  --invert-bg: #121316;
  --invert-text: #ffffff;
  --overlay: rgba(0, 0, 0, .45);
  --input-bg: #f7f6f3;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Manrope, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.ms {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

/* ===== Fond ===== */
/* Conteneur qui rogne le halo (1000px) pour éviter le scroll horizontal sur mobile */
.bg { position: absolute; top: 0; left: 0; right: 0; height: 760px; overflow: hidden; pointer-events: none; }
.bg-dots {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 30%, transparent 75%);
  animation: dots 8s linear infinite;
}
.bg-halo {
  position: absolute; left: 50%; top: -180px; width: 1000px; height: 640px; pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 90, 31, .22), rgba(47, 139, 214, .14) 55%, transparent);
  animation: drift 12s ease-in-out infinite alternate;
}

/* ===== Navigation ===== */
.nav-wrap { position: sticky; top: 0; z-index: 10; padding: 24px 24px 0; display: flex; justify-content: center; }
.nav {
  display: flex; align-items: center; gap: 20px;
  padding: 8px 8px 8px 20px; border-radius: 999px;
  background: var(--nav-bg); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: rise .7s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 14px; }
/* Les PNG ont des marges transparentes (49px en bas pour tbmaestro, 387px à droite pour Ammco) :
   on cadre sur la zone dessinée (même hauteur de 417px) pour que les deux carrés soient alignés */
.brand-logo { display: block; height: 22px; width: auto; object-fit: cover; object-position: left top; }
.brand-logo-tb { aspect-ratio: 1839 / 417; }
.brand-logo-am { aspect-ratio: 1467 / 417; }
.nav-sep { width: 1px; height: 18px; background: var(--line-strong); }
.nav-link { font-size: 14px; color: var(--muted); }
.nav-link:hover { color: var(--text); }
.btn-nav {
  height: 36px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--invert-bg); color: var(--invert-text);
  display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700;
}
.btn-nav .ms { font-size: 17px; }

/* ===== Hero ===== */
main { position: relative; max-width: 1280px; margin: 0 auto; padding: 0 56px; }
.hero { padding: 120px 0 110px; display: flex; flex-direction: column; align-items: flex-start; gap: 30px; container-type: inline-size; }
/* Titre toujours sur 3 lignes (retours forcés dans landing.html) : sur petit écran,
   la taille est plafonnée pour que la ligne la plus longue (~9.4em) tienne dans la largeur
   du hero (cqi), avec repli en vw pour les navigateurs sans container queries */
.hero h1 {
  margin: 0; max-width: 900px;
  font-size: min(clamp(38px, 5.6vw, 72px), calc((100vw - 40px) / 10.4));
  font-size: min(clamp(38px, 5.6vw, 72px), calc(100cqi / 10));
  line-height: 1; letter-spacing: -.042em; font-weight: 800;
}
.grad {
  background: linear-gradient(90deg, var(--orange), var(--violet), var(--blue), var(--violet), var(--orange));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
.hero p { margin: 0; max-width: 620px; font-size: 19px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.btn-cta {
  height: 56px; padding: 0 10px 0 28px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 700;
  box-shadow: 0 10px 40px rgba(255, 90, 31, .35);
  transition: transform .25s, box-shadow .25s;
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 16px 50px rgba(255, 90, 31, .5); }
.btn-cta-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
}
.btn-cta-icon .ms { font-size: 20px; animation: nudge 1.6s ease-in-out infinite; }

/* ===== Bento ===== */
.bento {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 12px;
  padding-bottom: 96px;
}
.tile {
  border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  padding: 22px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .3s var(--ease), border-color .3s;
}
.tile:hover { transform: translateY(-4px); border-color: rgba(255, 90, 31, .4); }
.tile .icon { font-size: 64px; color: var(--orange); animation: float 5s ease-in-out var(--f, 0s) infinite; }
.tile .icon-blue { color: var(--blue); }
.tile-label { font-size: 17px; font-weight: 600; }
.tile-xl { grid-column: span 2; grid-row: span 2; padding: 28px; }
.tile-xl .icon { font-size: 88px; }
.tile-xl .tile-label { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.tile-orange { background: linear-gradient(160deg, rgba(255, 90, 31, .16), var(--surface) 60%); }
.tile-wide { grid-column: span 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; padding: 0 28px; }
.tile-wide .icon { font-size: 72px; }
.tile-blue { background: linear-gradient(90deg, rgba(47, 139, 214, .14), var(--surface) 70%); }

/* ===== Contact ===== */
.contact { padding-bottom: 64px; }
.contact-card {
  position: relative; overflow: hidden;
  border-radius: 28px; background: var(--card); border: 1px solid var(--line);
  padding: 64px 56px; display: flex; flex-direction: column; gap: 20px;
}
.contact-glow {
  position: absolute; right: -160px; top: -200px; width: 560px; height: 480px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 90, 31, .16), transparent);
}
.contact h2 { position: relative; margin: 0; font-size: 20px; font-weight: 600; color: var(--muted); }
.contact-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.contact-lead {
  margin: 0; max-width: 640px;
  font-size: 32px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; text-wrap: balance;
}
.contact-mail-btn {
  width: 64px; height: 64px; flex: none; border: 0; border-radius: 50%; padding: 0;
  background: var(--orange); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .35s var(--ease);
}
.contact-mail-btn .ms { font-size: 28px; }
.contact-mail-btn:hover { transform: rotate(45deg) scale(1.08); }
.contact-social {
  position: relative; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted);
  padding-top: 28px; border-top: 1px solid var(--line);
}
.contact-social > span:first-child { flex: 1; }
.round {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
}
.round .ms { font-size: 18px; }
.round:hover { border-color: var(--orange); color: var(--orange); }

/* ===== Footer ===== */
.footer {
  position: relative; max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 24px 56px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint);
}

/* ===== Modal de connexion (email → SSO tbmaestro/ammco ou mot de passe externe) ===== */
.login-modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  align-items: center; justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s ease;
}
.login-modal.active { opacity: 1; }
.login-modal .modal-content {
  position: relative; width: 90%; max-width: 420px; padding: 32px;
  border-radius: 24px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  animation: modalFadeIn .3s var(--ease);
}
.login-modal .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.login-modal .modal-header h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.login-modal .close-modal {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s;
}
.login-modal .close-modal:hover { color: var(--orange); border-color: var(--orange); }
.login-modal-subtitle { margin: 0 0 24px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.login-modal .form-group { margin-bottom: 18px; }
.login-modal label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.login-modal input,
.login-modal textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--input-bg); color: var(--text);
  font-family: inherit; font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.login-modal textarea { display: block; min-height: 130px; resize: vertical; line-height: 1.5; }
.login-modal input:focus,
.login-modal textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 90, 31, .18); }
/* Bouton œil pour afficher / masquer le mot de passe (l'œil natif d'Edge est masqué pour ne pas en avoir deux) */
.login-modal .password-field { position: relative; }
.login-modal .password-field input { padding-right: 52px; }
.login-modal .password-field input::-ms-reveal { display: none; }
.login-modal .password-toggle {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 10px;
  background: none; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .2s;
}
.login-modal .password-toggle:hover { color: var(--orange); }
.login-modal .password-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.login-modal .password-toggle .material-symbols-rounded { font-size: 20px; }
/* Lien "Réinitialiser le mot de passe" sous le champ, et confirmation d'envoi de l'email */
.login-modal-forgot {
  display: block; margin: 10px 0 0 auto; padding: 0; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: color .2s;
}
.login-modal-forgot:hover { color: var(--orange); }
.login-modal-forgot:disabled { opacity: .6; cursor: progress; }
.login-modal-info { display: none; margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: #2fa36b; }
.login-modal-info.visible { display: block; }
.login-modal-error { display: none; margin: 0 0 16px; font-size: 14px; color: #f44336; }
.login-modal-error.visible { display: block; }
/* Email inconnu : lien vers le formulaire de contact, sous le message d'erreur */
.login-modal-contact { margin: -8px 0 16px; font-size: 14px; color: var(--muted); }
.login-modal-contact-link {
  padding: 0; border: none; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--orange);
  text-decoration: underline; text-underline-offset: 2px;
}
.login-modal-contact-link:hover { text-decoration: none; }
.login-modal .submit-button {
  width: 100%; height: 52px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(255, 90, 31, .3);
  transition: transform .25s, box-shadow .25s;
}
.login-modal .submit-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255, 90, 31, .45); }
.login-modal .submit-button:disabled { opacity: .7; cursor: not-allowed; }
.login-modal .submit-button.is-loading { opacity: .9; cursor: progress; }
.login-modal .submit-button .material-symbols-rounded { font-size: 20px; }
.login-modal-back {
  width: 100%; margin-top: 14px; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; color: var(--muted);
  transition: color .2s;
}
.login-modal-back:hover { color: var(--orange); }
.login-modal-back .material-symbols-rounded { font-size: 18px; }
/* Cercle de chargement affiché dans le bouton pendant la vérification / redirection */
.login-spinner {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: loginSpin .8s linear infinite;
}

/* ===== Modal de contact (réutilise les styles du modal de connexion) ===== */
.login-modal .contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-success { text-align: center; padding: 8px 0 4px; }
.contact-success .material-symbols-rounded { font-size: 48px; color: var(--orange); }
.contact-success p { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* ===== Animations ===== */
.reveal { animation: rise 1s var(--ease) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes drift { 0% { transform: translate(-50%, 0) scale(1); } 100% { transform: translate(-44%, 40px) scale(1.12); } }
@keyframes dots { to { background-position: 22px 22px; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes loginSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  main { padding: 0 20px; }
  .hero { padding: 72px 0 64px; }
  .nav-wrap { padding: 16px 16px 0; }
  .nav { gap: 10px; padding: 6px 6px 6px 14px; }
  .nav-sep, .nav-link { display: none; }
  .brand { gap: 10px; }
  .brand-logo { height: 18px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-wide { grid-column: span 2; }
  .contact-card { padding: 36px 24px; }
  .contact-lead { font-size: 24px; }
  .footer { flex-direction: column; padding: 24px 20px; }
}
@media (max-width: 500px) {
  .login-modal .modal-content { width: 92%; padding: 24px; }
}
/* Petits téléphones : logos + « Se connecter » doivent tenir sur une ligne */
@media (max-width: 400px) {
  .nav-wrap { padding: 12px 12px 0; }
  .brand-logo { height: 16px; }
  .btn-nav { padding: 0 12px; font-size: 13px; }
  .btn-nav .ms { display: none; }
}
