/* ============================================================
   HOKKO studio: Espace client (auth)
   Popup de connexion + pages /connexion, /reinitialiser, /espace-client
   Palette figée (indépendante des variables inline des pages).
   ============================================================ */

:root {
  --auth-navy: #0B1120;
  --auth-blue: #2D8EFF;
  --auth-blue-l: #5AAEFF;
  --auth-white: #ffffff;
  --auth-text: #E8EDF5;
  --auth-muted: #8A9BB5;
  --auth-bdr: rgba(255, 255, 255, 0.10);
  --auth-panel: linear-gradient(165deg, #182032, #0f1727);
  --auth-field: rgba(255, 255, 255, 0.04);
  --auth-danger: #ff6b6b;
  --auth-ok: #2DC89A;
}

/* ── Boutons d'accès (nav / footer) ── */
.nav-login {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--auth-text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border-radius: 100px;
  border: 1px solid var(--auth-bdr);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.nav-login:hover {
  border-color: rgba(45, 142, 255, 0.55);
  background: rgba(45, 142, 255, 0.12);
  color: #fff;
  transform: translateY(-1px);
}
.nav-login svg { width: 15px; height: 15px; }

.footer-login {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--auth-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s;
}
.footer-login:hover { color: var(--auth-blue-l); }
.footer-login svg { width: 14px; height: 14px; }

/* ── Overlay + panneau ── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.auth-modal.is-open { display: flex; }

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: authFade .25s ease;
}

.auth-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  background: var(--auth-panel);
  border: 1px solid var(--auth-bdr);
  border-radius: 22px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: authPop .32s cubic-bezier(.2, .9, .3, 1.2);
}

/* Version page (connexion / reset / espace) */
.auth-standalone {
  min-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}
.auth-standalone .auth-panel {
  animation: authFade .35s ease;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

@keyframes authFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes authPop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── En-tête ── */
.auth-close-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--auth-bdr);
  background: rgba(255, 255, 255, 0.03);
  color: var(--auth-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .2s;
}
.auth-close-btn:hover { color: #fff; border-color: rgba(255,255,255,0.25); transform: rotate(90deg); }

.auth-header { text-align: center; margin-bottom: 1.4rem; }
.auth-header-logo { height: 40px; width: auto; margin: 0 auto 0.9rem; display: block; }
.auth-header-title {
  font-family: 'Syne', 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.35rem;
  letter-spacing: 0.01em;
}
.auth-header p { color: var(--auth-muted); font-size: 0.88rem; margin: 0; }

/* ── Onglets ── */
.auth-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--auth-bdr);
  border-radius: 100px;
  margin-bottom: 1.4rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.55rem 0.6rem;
  border-radius: 100px;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.auth-tab.is-active { color: #fff; background: var(--auth-blue); box-shadow: 0 6px 18px rgba(45,142,255,0.35); }

/* ── Vues / formulaires ── */
.auth-view { display: none; }
.auth-view.is-active { display: block; animation: authFade .25s ease; }

.auth-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--auth-text);
  margin: 0.85rem 0 0.4rem;
  letter-spacing: 0.02em;
}
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--auth-bdr);
  background: var(--auth-field);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.auth-form input::placeholder { color: rgba(138, 155, 181, 0.6); }
.auth-form input:focus {
  outline: none;
  border-color: rgba(45, 142, 255, 0.65);
  background: rgba(45, 142, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(45, 142, 255, 0.15);
}

.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 4.2rem; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--auth-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.auth-password-toggle:hover { color: #fff; background: rgba(255,255,255,0.06); }

.auth-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.6rem;
}
.auth-row a {
  color: var(--auth-blue-l);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.auth-row a:hover { text-decoration: underline; }

.auth-note {
  color: var(--auth-muted, #8A9BB5);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 0.85rem;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
  color: #c8d4e6;
  font-size: 0.86rem;
  line-height: 1.4;
  cursor: pointer;
}

.auth-check input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  accent-color: #2D8EFF;
}

.auth-submit {
  width: 100%;
  margin-top: 1.3rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--auth-blue), var(--auth-blue-l));
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .2s, opacity .2s;
  box-shadow: 0 10px 26px rgba(45, 142, 255, 0.3);
}
.auth-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(45, 142, 255, 0.42); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Messages ── */
.auth-msg {
  display: none;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.45;
}
.auth-msg.show { display: block; animation: authFade .2s ease; }
.auth-msg.error { background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4); color: #ffc9c9; }
.auth-msg.success { background: rgba(45, 200, 154, 0.12); border: 1px solid rgba(45, 200, 154, 0.4); color: #b6f0dc; }

.auth-foot-note {
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--auth-bdr);
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ── Espace client (placeholder dashboard) ── */
.espace-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
}
.espace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.25rem;
}
.espace-head h1 {
  font-family: 'Syne', 'Poppins', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.espace-head p { color: var(--auth-muted); margin: 0.35rem 0 0; }
.espace-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: 100px;
  border: 1px solid var(--auth-bdr);
  background: rgba(255, 255, 255, 0.03);
  color: var(--auth-text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.espace-logout:hover { border-color: rgba(255,107,107,0.5); background: rgba(255,107,107,0.1); color: #ffd0d0; }

.espace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.espace-card {
  background: var(--auth-panel);
  border: 1px solid var(--auth-bdr);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.espace-card h3 {
  font-family: 'Syne', 'Poppins', sans-serif;
  font-size: 1.05rem;
  color: #fff;
  margin: 0 0 0.5rem;
}
.espace-card p { color: var(--auth-muted); font-size: 0.88rem; margin: 0; line-height: 1.55; }
.espace-card .espace-ic {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(45, 142, 255, 0.12);
  border: 1px solid rgba(45, 142, 255, 0.28);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.espace-badge {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--auth-bdr);
  color: var(--auth-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Responsive ── */
/* Footer mobile : empiler Espace client → copyright → réseaux (écrase le flex des pages) */
@media (max-width: 768px) {
  footer .fb2 {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem !important;
    width: 100% !important;
    padding-right: 0 !important;
    padding-top: 1.25rem !important;
  }
  footer .footer-login {
    order: 1;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: flex-start;
  }
  footer .fb2 > span {
    order: 2;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    line-height: 1.45 !important;
  }
  footer .fsoc {
    order: 3;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-right: 4.75rem !important;
    box-sizing: border-box !important;
    gap: 0.5rem !important;
  }
  footer .fsi {
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .auth-panel { padding: 1.6rem 1.35rem 1.4rem; border-radius: 18px; }
  .auth-header-title { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-backdrop, .auth-panel, .auth-view, .auth-msg, .auth-standalone .auth-panel { animation: none; }
  .auth-submit, .nav-login, .auth-close-btn { transition: none; }
}
