/* Espace client + questionnaire (n’affecte pas l’admin)
   - Dashboard : fond blanc lisible + accents dégradés
   - Questionnaire / connexion : fond dégradé immersif
*/

body.is-client,
body.q-body,
body.guest-client {
  --c-light: #c1e3f9;
  --c-sky: #54a5ea;
  --c-blue: #3f7fe1;
  --c-peri: #5357d7;
  --c-violet: #7c2acc;
  --c-white: #ffffff;
  --c-black: #000000;
  --ink: #12131a;
  --muted: #5b6475;
  --line: #d7e4f4;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --shadow-card: 0 18px 40px rgba(63, 127, 225, 0.10);
  --grad: linear-gradient(145deg, #54a5ea 0%, #3f7fe1 28%, #5357d7 62%, #7c2acc 100%);
  --grad-soft: linear-gradient(135deg, rgba(84, 165, 234, 0.95), rgba(124, 42, 204, 0.9));
  --grad-side: linear-gradient(180deg, #54a5ea 0%, #5357d7 55%, #7c2acc 100%);

  margin: 0;
  min-height: 100vh;
  font-family: "Raleway", "Segoe UI", sans-serif;
  color: var(--ink);
}

body.is-client .app-shell,
body.q-body .app-shell,
body.guest-client .guest-wrap {
  min-height: 100vh;
}

/* =========================================================
   DASHBOARD CLIENT — fond blanc + bandeau dégradé latéral
   ========================================================= */

html body.is-client:not(.q-body) {
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  background-attachment: fixed;
}

body.is-client:not(.q-body) .app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

body.is-client:not(.q-body) .app-shell::before {
  content: "";
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(10px, 1.4vw, 18px);
  background: var(--grad-side);
  box-shadow: 4px 0 24px rgba(83, 87, 215, 0.18);
  z-index: 40;
  pointer-events: none;
}

body.is-client:not(.q-body) .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem clamp(1.25rem, 3vw, 2rem) 0.95rem clamp(1.6rem, 3.5vw, 2.4rem);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

body.is-client:not(.q-body) .brand__logo {
  height: 44px;
  width: auto;
  max-width: min(220px, 55vw);
  filter: none;
}

body.is-client:not(.q-body) .brand__tag {
  background: rgba(193, 227, 249, 0.65);
  color: var(--c-peri);
  border: 1px solid rgba(84, 165, 234, 0.35);
}

body.is-client:not(.q-body) .nav a,
body.is-client:not(.q-body) .nav-user {
  color: var(--ink);
}

body.is-client:not(.q-body) .nav a:hover {
  background: rgba(193, 227, 249, 0.55);
  color: var(--c-peri);
}

body.is-client:not(.q-body) .nav a.is-active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(63, 127, 225, 0.28);
}

body.is-client:not(.q-body) .topbar .btn-ghost {
  border: 1px solid var(--line);
  color: var(--c-peri);
  background: #fff;
}

body.is-client:not(.q-body) .topbar .btn-ghost:hover {
  background: rgba(193, 227, 249, 0.55);
  color: var(--c-blue);
}

body.is-client:not(.q-body) .footer {
  color: var(--muted);
  padding-left: clamp(1.6rem, 3.5vw, 2.4rem);
}

body.is-client:not(.q-body) .page {
  width: min(920px, calc(100% - 2.5rem));
  margin: 1.25rem auto 2.5rem;
  padding-left: 0.35rem;
}

body.is-client:not(.q-body) .page-header h1 {
  font-family: "DM Sans", "Questrial", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: clamp(1.7rem, 3.6vw, 2.15rem);
  text-transform: none;
}

body.is-client:not(.q-body) .page-header p,
body.is-client:not(.q-body) .form-hint,
body.is-client:not(.q-body) .back-link {
  color: var(--muted);
}

body.is-client:not(.q-body) .back-link:hover {
  color: var(--c-peri);
}

body.is-client:not(.q-body) .panel,
body.is-client:not(.q-body) .card,
body.is-client:not(.q-body) .empty-state {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

/* Accent dégradé sur le bord des cartes de valeur */
body.is-client:not(.q-body) .panel::before,
body.is-client:not(.q-body) .card::before,
body.is-client:not(.q-body) .empty-state::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--grad-side);
}

body.is-client:not(.q-body) .panel,
body.is-client:not(.q-body) .empty-state {
  padding: 1.25rem 1.35rem 1.35rem 1.45rem;
}

body.is-client:not(.q-body) .panel__head h2,
body.is-client:not(.q-body) .card__title,
body.is-client:not(.q-body) h2 {
  font-family: "Questrial", sans-serif;
  color: var(--c-peri);
}

body.is-client:not(.q-body) .panel p,
body.is-client:not(.q-body) .empty-state p {
  color: var(--muted);
}

body.is-client:not(.q-body) .btn-primary {
  background: var(--grad);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 28px rgba(63, 127, 225, 0.28);
}

body.is-client:not(.q-body) .btn-secondary {
  background: rgba(193, 227, 249, 0.75);
  color: var(--c-peri);
  border: 0;
}

body.is-client:not(.q-body) .badge--ok,
body.is-client:not(.q-body) .badge--info {
  background: rgba(193, 227, 249, 0.75);
  color: var(--c-peri);
}

body.is-client:not(.q-body) .alert-success {
  background: rgba(193, 227, 249, 0.85);
  color: var(--c-peri);
  border-color: #9fd0f3;
}

body.is-client:not(.q-body) .form-row input,
body.is-client:not(.q-body) .form-row textarea,
body.is-client:not(.q-body) .form-row select {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: "Raleway", sans-serif;
  font-size: 1rem;
  padding: 0.95rem 1rem;
}

body.is-client:not(.q-body) .form-row input:focus,
body.is-client:not(.q-body) .form-row textarea:focus {
  outline: 2px solid rgba(84, 165, 234, 0.35);
  border-color: var(--c-sky);
}

body.is-client .panel .btn-ghost,
body.is-client .empty-state .btn-ghost {
  border: 1px solid var(--line);
  color: var(--c-peri);
  background: #fff;
}

body.is-client .panel .btn-ghost:hover {
  background: rgba(193, 227, 249, 0.55);
  color: var(--c-blue);
}

/* =========================================================
   QUESTIONNAIRE — fond dégradé immersif (inchangé dans l’esprit)
   ========================================================= */

body.q-body {
  background: var(--grad);
  background-attachment: fixed;
  color: var(--ink);
}

body.q-body .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem clamp(1rem, 3vw, 2rem);
  background: rgba(255, 255, 255, 0.97);
  border: 0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(32, 28, 74, 0.08);
}

body.q-body .brand__logo {
  height: 44px;
  width: auto;
  max-width: min(220px, 55vw);
  filter: none;
}

body.q-body .brand__tag {
  background: rgba(193, 227, 249, 0.65);
  color: var(--c-peri);
  border: 1px solid rgba(84, 165, 234, 0.35);
}

body.q-body .nav a,
body.q-body .nav-user {
  color: var(--ink);
}

body.q-body .nav a:hover {
  background: rgba(193, 227, 249, 0.55);
  color: var(--c-peri);
}

body.q-body .nav a.is-active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(63, 127, 225, 0.28);
}

body.q-body .topbar .btn-ghost {
  border: 1px solid var(--line);
  color: var(--c-peri);
  background: #fff;
}

body.q-body .topbar .btn-ghost:hover {
  background: rgba(193, 227, 249, 0.55);
  color: var(--c-blue);
}

body.q-body .footer {
  color: rgba(255, 255, 255, 0.75);
}

body.q-body .page {
  width: min(760px, calc(100% - 1.5rem));
  margin: 0.5rem auto 2.5rem;
}

body.q-body h1 {
  font-family: "DM Sans", "Questrial", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
}

body.q-body .q-card {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.q-body .btn-primary {
  background: var(--grad);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 28px rgba(63, 127, 225, 0.35);
}

body.q-body .btn-secondary {
  background: rgba(193, 227, 249, 0.65);
  color: var(--c-peri);
}

body.q-body .q-shell-card .btn-ghost {
  border: 1px solid #d7e4f4;
  color: #5357d7;
  background: #fff;
}

body.q-body .q-shell-card .btn-ghost:hover {
  background: rgba(193, 227, 249, 0.55);
  color: #3f7fe1;
}

body.q-body .q-shell-card .btn-secondary {
  background: rgba(193, 227, 249, 0.75);
  color: #5357d7;
  border: 0;
}

body.q-body .q-shell-card .btn-secondary:hover {
  background: #c1e3f9;
  color: #3f7fe1;
}

body.q-body .q-field input:not([type="radio"]):not([type="checkbox"]),
body.q-body .q-field textarea {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid #d7e4f4;
  background: #fff;
  font-family: "Raleway", sans-serif;
  font-size: 1rem;
  padding: 0.95rem 1rem;
}

body.q-body .q-field input:not([type="radio"]):not([type="checkbox"]):focus,
body.q-body .q-field textarea:focus {
  outline: 2px solid rgba(84, 165, 234, 0.35);
  border-color: var(--c-sky);
}

body.q-body .q-choice {
  justify-content: flex-start;
  align-items: center;
  text-align: left;
}

body.q-body .q-choice input[type="radio"],
body.q-body .q-choice input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  max-width: 1.15rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #5357d7;
}

body.q-body .q-choice span {
  flex: 1 1 auto;
  text-align: left;
  font-family: "Raleway", sans-serif;
  color: var(--ink);
}

/* =========================================================
   CONNEXION — fond dégradé + carte blanche
   ========================================================= */

body.guest-client {
  background: var(--grad);
  background-attachment: fixed;
}

body.guest-client .guest-wrap {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--grad);
  background-attachment: fixed;
}

body.guest-client .guest-stack {
  width: min(440px, 100%);
}

body.guest-client .auth-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(32, 28, 74, 0.22);
  padding: 1.75rem 1.5rem 1.5rem;
}

body.guest-client .auth-logo {
  display: block;
  margin: 0 auto 1.15rem;
  filter: none;
  width: auto !important;
  height: auto !important;
  max-width: min(240px, 78%);
  max-height: 168px;
  object-fit: contain;
  object-position: center;
}

body.guest-client .auth-mascot {
  display: none !important;
}

body.guest-client .auth-card h1 {
  font-family: "DM Sans", "Questrial", sans-serif;
  font-weight: 700;
  text-align: center;
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-transform: none;
}

body.guest-client .auth-card > p {
  text-align: center;
}

body.guest-client .btn-primary {
  background: var(--grad);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 28px rgba(63, 127, 225, 0.35);
}

body.guest-client .form-row input {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 16px;
  border: 1px solid #d7e4f4;
  background: #fff;
  font-family: "Raleway", sans-serif;
  font-size: 1rem;
  padding: 0.95rem 1rem;
}

body.guest-client .form-row input:focus {
  outline: 2px solid rgba(84, 165, 234, 0.35);
  border-color: var(--c-sky);
}

body.guest-client .password-field {
  position: relative;
}

body.guest-client .password-field input {
  padding-right: 3rem;
}

body.guest-client .password-toggle {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #5b6b86;
  border-radius: 999px;
  padding: 0;
}

body.guest-client .password-toggle:hover,
body.guest-client .password-toggle:focus-visible {
  color: #24324a;
  outline: none;
  background: rgba(84, 165, 234, 0.12);
}

body.guest-client .password-toggle__eye {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.guest-client .password-toggle.is-on .password-toggle__eye {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.82 21.82 0 0 1-2.16 3.19'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.94 10.94 0 0 1 12 20c-7 0-11-8-11-8a21.77 21.77 0 0 1 5.06-5.94'/%3E%3Cpath d='M9.9 4.24A10.94 10.94 0 0 1 12 4c7 0 11 8 11 8a21.82 21.82 0 0 1-2.16 3.19'/%3E%3Cpath d='M14.12 14.12a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.guest-client .form-actions--auth {
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

body.guest-client .form-actions--auth .btn {
  width: 100%;
  justify-content: center;
}

body.guest-client .auth-forgot {
  text-align: center;
  color: #4a5d7a;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

body.guest-client .auth-forgot:hover {
  color: #24324a;
}

/* Masquer mascottes éventuelles côté client */
body.is-client .q-welcome-mascot,
body.q-body .q-welcome-mascot,
body.guest-client .auth-mascot {
  display: none !important;
}

@media (max-width: 700px) {
  body.is-client:not(.q-body) .app-shell::before {
    width: 8px;
  }

  body.is-client .topbar,
  body.q-body .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  body.is-client:not(.q-body) .page {
    width: calc(100% - 1.25rem);
    margin-left: auto;
    margin-right: 0.4rem;
  }
}
