:root {
  /* Palette « Nuit indigo » : volontairement distincte de Bolduc (vert sapin, crème, rouge, doré). */
  --nuit: #1b1d3a;
  --nuit-fonce: #141530;
  --texte-fond: #f3f1fa;
  --texte-clair: #b9b8d6;
  --carte: #faf9fd;
  --encre: #1c1b2e;
  --encre-douce: #57566e;
  --action: #5b4bdb;
  --action-fonce: #4738c2;
  --ambre: #f2b544;
  --ligne: #e3e1ef;
  --succes-fond: #e3f2e8;
  --succes-texte: #1d5a36;
  --erreur-fond: #fce6e3;
  --erreur-texte: #8f2412;
  --rayon: 18px;
  --titres: 'Sora', system-ui, sans-serif;
  --texte: 'DM Sans', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--nuit);
  color: var(--texte-fond);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.page {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.page--large {
  max-width: 560px;
}

/* En-tête */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
  font-family: var(--titres);
  color: var(--texte-fond);
}

.brand__logo {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--action);
  transform: rotate(-8deg);
  display: grid;
  place-items: center;
}

.brand__name {
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.5px;
}

h1,
h2,
h3 {
  font-family: var(--titres);
  line-height: 1.15;
  margin: 0 0 8px;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 21px;
  font-weight: 700;
}

.intro {
  color: var(--texte-clair);
  margin: 0 0 22px;
}

.intro strong {
  color: var(--ambre);
  font-weight: 600;
}

/* Cartes */
.card {
  background: var(--carte);
  color: var(--encre);
  border-radius: var(--rayon);
  padding: 22px 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.card > :last-child {
  margin-bottom: 0;
}

.card p {
  margin: 0 0 14px;
}

.muted {
  color: var(--encre-douce);
  font-size: 15px;
}

/* Formulaires */
.field {
  display: block;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field__hint {
  display: block;
  font-size: 14px;
  color: var(--encre-douce);
  margin-top: 6px;
}

.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 2px solid var(--ligne);
  border-radius: 12px;
  background: #fff;
  color: var(--encre);
  font: inherit;
  font-size: 17px;
}

.input:focus {
  outline: none;
  border-color: var(--ambre);
  box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.35);
}

.password {
  position: relative;
}

.password .input {
  padding-right: 96px;
}

.password__toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--encre-douce);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* Boutons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.link:focus-visible {
  outline: 3px solid var(--ambre);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--action);
  color: #fff;
}

.btn--primary:hover {
  background: var(--action-fonce);
}

.btn--secondary {
  background: transparent;
  border-color: var(--encre);
  color: var(--encre);
}

.btn--secondary:hover {
  background: rgba(28, 27, 46, 0.06);
}

.btn--light {
  background: transparent;
  border-color: var(--texte-fond);
  color: var(--texte-fond);
}

.btn--light:hover {
  background: rgba(243, 241, 250, 0.08);
}

.btn--small {
  width: auto;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
}

.btn--danger-text {
  background: transparent;
  color: var(--erreur-texte);
  border: 0;
  width: auto;
  min-height: 44px;
  padding: 8px 4px;
  font-size: 15px;
}

.stack > * + * {
  margin-top: 12px;
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

.links {
  text-align: center;
  color: var(--texte-clair);
  margin-top: 18px;
}

.links a {
  color: var(--texte-fond);
}

.separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--encre-douce);
  font-size: 15px;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ligne);
}

/* Messages */
.alert {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert--error {
  background: var(--erreur-fond);
  color: var(--erreur-texte);
}

.alert--success {
  background: var(--succes-fond);
  color: var(--succes-texte);
}

.alert[hidden] {
  display: none;
}

/* Listes (passkeys, apps) */
.list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ligne);
}

.list__item:last-child {
  border-bottom: 0;
}

.list__title {
  font-weight: 600;
}

.list__meta {
  font-size: 14px;
  color: var(--encre-douce);
}

details.edit {
  border-top: 1px solid var(--ligne);
  padding-top: 4px;
  margin-top: 4px;
}

details.edit summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

details.edit summary::-webkit-details-marker {
  display: none;
}

details.edit summary::after {
  content: 'Modifier';
  font-size: 15px;
  color: var(--action);
}

details.edit[open] summary::after {
  content: 'Fermer';
}

details.edit form {
  padding: 6px 0 12px;
}

.summary-value {
  display: block;
  font-weight: 400;
  color: var(--encre-douce);
  font-size: 15px;
}

.footer {
  text-align: center;
  margin-top: 28px;
}

@media (min-width: 600px) {
  .page {
    padding-top: 56px;
  }

  .card {
    padding: 28px 26px;
  }
}

.card-links {
  text-align: center;
  margin: 8px 0 0;
}

.card-links a {
  color: var(--encre);
}

.hello {
  margin: 0 0 2px;
  color: var(--texte-clair);
}

.notice {
  background: #fdf3dc;
  border-left: 4px solid var(--ambre);
  border-radius: 12px;
  padding: 14px;
  margin: 8px 0 12px;
}

.notice p {
  margin: 0 0 10px;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  vertical-align: 1px;
}

.badge--ok {
  background: var(--succes-fond);
  color: var(--succes-texte);
}

.badge--todo {
  background: #fdf3dc;
  color: #7a5410;
}

.card a:not(.btn) {
  color: var(--action);
  font-weight: 600;
}

.tips,
.steps {
  margin: 0 0 6px;
  padding-left: 22px;
}

.tips li,
.steps li {
  margin-bottom: 10px;
}

.steps li::marker {
  font-family: var(--titres);
  font-weight: 800;
  color: var(--action);
}

.intro-link {
  color: var(--ambre);
  font-weight: 600;
  white-space: nowrap;
}

.card--danger {
  margin-top: 28px;
  padding-top: 8px;
  padding-bottom: 8px;
}

details.edit--danger {
  border-top: 0;
  margin-top: 0;
}

details.edit--danger summary {
  color: var(--erreur-texte);
}

details.edit--danger summary::after {
  content: 'Afficher';
  color: var(--erreur-texte);
}

details.edit--danger[open] summary::after {
  content: 'Fermer';
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 14px;
  font-weight: 600;
}

.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--erreur-texte);
}

.btn--danger {
  background: var(--erreur-texte);
  color: #fff;
}

.btn--danger:hover {
  background: #741c0d;
}
