
/* =========================================================
   SOCLE UI — Charte graphique commune
   ========================================================= */

:root {
  --socle-navy: #101a35;
  --socle-blue: #4169f5;
  --socle-blue-dark: #2446d7;
  --socle-cyan: #62e6ff;
  --socle-text: #26334d;
  --socle-muted: #74809a;
  --socle-line: #e3e9f3;
  --socle-danger: #b42335;
  --socle-success: #13845b;
  --socle-white: #ffffff;
  --socle-radius: 20px;
  --socle-shadow: 0 20px 60px rgba(25, 48, 100, 0.12);
}

* {
  box-sizing: border-box;
}

/* Respecte les états cachés utilisés par les scripts des pages. */
[hidden],
.hidden {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 32px 18px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Arial, sans-serif;
  color: var(--socle-text);
  background:
    radial-gradient(ellipse at 10% 5%, #dce8ff 0, transparent 42%),
    radial-gradient(ellipse at 90% 10%, #d8f7ff 0, transparent 38%),
    #f3f6fc;
  line-height: 1.5;
}

/* Titres */

h1, h2, h3 {
  color: var(--socle-navy);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  margin: 0 0 12px;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 12px;
}

p {
  line-height: 1.6;
}

small,
.muted,
.subtitle {
  color: var(--socle-muted);
}

/* Cartes et conteneurs courants */

main,
.card,
.container,
.panel,
.auth-card {
  position: relative;
  background: var(--socle-white);
  border: 1px solid rgba(227, 233, 243, 0.95);
  border-radius: var(--socle-radius);
  box-shadow: var(--socle-shadow);
}

main,
.card,
.auth-card {
  padding: 32px;
  width: 100%;
  max-width: 760px;
  margin: 24px auto;
  overflow: hidden;
}

/* Bande décorative supérieure */

main::before,
.card::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--socle-blue-dark),
    var(--socle-blue),
    var(--socle-cyan)
  );
}

/* Formulaires */

form {
  width: 100%;
}

label {
  display: block;
  margin: 15px 0 6px;
  color: var(--socle-navy);
  font-size: 0.92rem;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #d6deeb;
  border-radius: 11px;
  background: #fff;
  color: var(--socle-text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--socle-blue);
  box-shadow: 0 0 0 4px rgba(65, 105, 245, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f2f5fa;
  color: #8993a7;
  cursor: not-allowed;
}

/* Boutons */

button,
input[type="submit"],
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 19px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(
    110deg,
    var(--socle-blue-dark),
    var(--socle-blue),
    #278cda
  );
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}

button:hover,
input[type="submit"]:hover,
.button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(36, 70, 215, 0.2);
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button.secondary,
.button.secondary,
.btn-secondary {
  color: var(--socle-navy);
  background: #edf2ff;
  border: 1px solid #dbe4ff;
  box-shadow: none;
}

button.danger,
.btn-danger {
  background: var(--socle-danger);
}

/* Liens */

a {
  color: var(--socle-blue-dark);
  text-decoration: none;
  font-weight: 550;
}

a:hover {
  text-decoration: underline;
}

/* Messages de statut */

#message,
.message,
.alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--socle-line);
  border-radius: 11px;
  background: #f6f8fc;
  overflow-wrap: anywhere;
}

.error,
.message.error,
.alert-danger {
  color: var(--socle-danger);
  background: #fff1f2;
  border-color: #ffd6dc;
}

.success,
.message.success,
.alert-success {
  color: var(--socle-success);
  background: #ecfdf5;
  border-color: #b8ecd4;
}

/* Éléments de séparation */

hr {
  border: 0;
  border-top: 1px solid var(--socle-line);
  margin: 24px 0;
}

fieldset {
  min-width: 0;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--socle-line);
  border-radius: 13px;
}

legend {
  padding: 0 8px;
  color: var(--socle-navy);
  font-weight: 650;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--socle-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--socle-navy);
  background: #f4f7fd;
  font-weight: 650;
}

/* Accessibilité et affichage mobile */

:focus-visible {
  outline: 3px solid rgba(65, 105, 245, 0.45);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  body {
    padding: 16px 10px;
  }

  main,
  .card,
  .auth-card {
    padding: 24px 18px;
    margin: 12px auto;
    border-radius: 16px;
  }

  button,
  .button,
  .btn,
  input[type="submit"] {
    max-width: 100%;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ===== Compléments pages d'authentification SOCLE UI ===== */

.auth-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  animation: socle-appear .45s ease-out both;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 0 auto 22px;
  color: var(--socle-navy);
  font-weight: 800;
  letter-spacing: .02em;
}

.auth-brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2447cf, #60d9ff);
  box-shadow: 0 8px 22px rgba(65, 105, 245, .25);
  font-size: 1.25rem;
}

.auth-brand-name {
  font-size: 1.1rem;
}

.auth-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px;
}

.auth-main .intro {
  margin: 0 0 24px;
  color: var(--socle-muted);
  line-height: 1.65;
}

.auth-main form > button,
.auth-main form > .button,
.auth-main form > input[type="submit"] {
  width: 100%;
  margin-top: 22px;
}

.auth-footer {
  margin: 20px 0 0;
  color: var(--socle-muted);
  text-align: center;
  font-size: .75rem;
  letter-spacing: .12em;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  font-size: .9rem;
}

.auth-note {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid var(--socle-line);
  border-radius: 11px;
  background: #f6f8fc;
  color: var(--socle-muted);
  font-size: .88rem;
}

.auth-step {
  margin: 22px 0 10px;
  padding: 16px;
  border: 1px solid var(--socle-line);
  border-radius: 13px;
  background: #f8faff;
}

.auth-step h2 {
  margin-bottom: 8px;
}

.auth-step[hidden] {
  display: none !important;
}

.auth-secret {
  display: block;
  margin: 12px 0;
  padding: 13px;
  border: 1px dashed #b8c7ef;
  border-radius: 10px;
  background: #fff;
  color: var(--socle-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.auth-message:empty {
  display: none;
}

.auth-message {
  overflow-wrap: anywhere;
}

.auth-main .help-text {
  display: block;
  margin-top: 6px;
  color: var(--socle-muted);
  font-size: .83rem;
}

@keyframes socle-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .auth-main {
    padding: 25px 19px;
  }

  .auth-links {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell {
    animation: none;
  }
}



/* ===== Composants partagés utilisés par les pages existantes ===== */

.intro {
  color: var(--socle-muted);
  line-height: 1.65;
}

.hint,
.help-text {
  display: block;
  margin: 6px 0 0;
  color: var(--socle-muted);
  font-size: .84rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.grid > div {
  min-width: 0;
}

.notice {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--socle-line);
  border-radius: 11px;
  background: #f6f8fc;
  color: var(--socle-text);
  overflow-wrap: anywhere;
}

.notice.error,
.notice.is-error {
  color: var(--socle-danger);
  border-color: #ffd6dc;
  background: #fff1f2;
}

.notice.success,
.notice.is-success {
  color: var(--socle-success);
  border-color: #b8ecd4;
  background: #ecfdf5;
}

.secret {
  display: block;
  margin: 12px 0;
  padding: 13px;
  border: 1px dashed #b8c7ef;
  border-radius: 10px;
  background: #f8faff;
  color: var(--socle-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.actions button {
  flex: 0 1 auto;
}

.links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  font-size: .9rem;
}

.message:empty {
  display: none;
}

.register-main {
  max-width: 760px;
}

.register-main > form > button,
.register-main #totpForm > button {
  margin-top: 18px;
}

.register-main #totpSection {
  margin-top: 22px;
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }

  .links {
    flex-direction: column;
  }
}
