/* ── Identité HexaRelay (Léon, Finch, Deckard, Wolff, Vision…) ───────────────
   Anthracite + ambre, étiquettes en petites capitales espacées, coins nets (2 px), titre en Georgia
   avec une touche d'ambre, devise sous le titre. Tokens repris à l'identique de Wolff. */
:root {
  --anthracite:   #16181c;
  --anthracite-2: #1d2024;
  --line:         #2c3036;
  --text:         #e8e4dc;
  --text-dim:     #8b8a85;
  --text-faint:   #5a5b58;
  --amber:        #e0a04a;
  --amber-hover:  #e8ae5f;
  --field-bg:     #101216;
  --success:      #7fae6f;
  --danger:       #c9695a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; min-height: 100dvh;
  background: var(--anthracite); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }

.eyebrow { font-size: .68rem; font-variant: small-caps; letter-spacing: .24em; text-transform: uppercase; color: var(--text-faint); }
.label { display: block; margin: 0 0 .4rem; font-size: .62rem; font-variant: small-caps; letter-spacing: .22em; text-transform: uppercase; color: var(--text-dim); }
.brand { font-family: Georgia, "Times New Roman", Times, serif; font-weight: normal; color: var(--text); }
.accent { color: var(--amber); }

input {
  width: 100%; padding: 10px 12px; background: var(--field-bg); border: 1px solid var(--line); border-radius: 2px;
  color: var(--text); font-family: inherit; font-size: .9rem;
}
input:focus { outline: none; border-color: var(--amber); }
input::placeholder { color: var(--text-faint); }

.btn-primary {
  padding: 10px 22px; background: var(--amber); border: none; border-radius: 2px; color: #1a1408; cursor: pointer;
  font-size: .68rem; font-variant: small-caps; letter-spacing: .2em; text-transform: uppercase; font-weight: 600;
}
.btn-primary:hover { background: var(--amber-hover); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.error-text { margin: .5rem 0 0; font-size: .78rem; color: var(--danger); }

@keyframes pulseHalo {
  0%   { box-shadow: 0 0 0 0   rgba(224, 160, 74, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(224, 160, 74, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(224, 160, 74, 0);   }
}
.pulse { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); animation: pulseHalo 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ── Écran d'entrée ───────────────────────────────────────────────────── */
.login-root { display: flex; flex-direction: row; justify-content: center; height: 100dvh; overflow: hidden; }

.panel {
  flex: 0 0 clamp(340px, 28vw, 460px); display: flex; flex-direction: column; justify-content: center;
  padding: 3.5rem 3rem 3rem; height: 100dvh; overflow-y: auto; position: relative; z-index: 1;
}
.portrait-panel { flex: 0 0 clamp(280px, 44vw, 660px); position: relative; overflow: hidden; height: 100dvh; }
.portrait-panel img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 30%; display: block; }
.portrait-fade { position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(to right, var(--anthracite) 0%, transparent 100%); z-index: 1; pointer-events: none; }

.avatar-wrap { display: none; margin: 0 auto 1.75rem; }
.avatar {
  width: clamp(100px, 28vw, 160px); height: clamp(100px, 28vw, 160px); border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 1px solid var(--line); box-shadow: 0 0 0 4px rgba(224, 160, 74, .07); display: block;
}

.eyebrow-row { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; }
.brand-title { font-size: clamp(2.6rem, 7vw, 3.4rem); line-height: 1; margin: 0 0 .4rem; }
.motto { font-size: .68rem; font-variant: small-caps; letter-spacing: .32em; text-transform: uppercase; color: var(--amber); opacity: .68; margin: 0 0 2rem; }

.auth-block { display: flex; flex-direction: column; gap: .85rem; }
.field { display: flex; flex-direction: column; }
.totp-input { text-align: center; letter-spacing: .5em; font-family: "Courier New", monospace; font-size: 1.5rem; padding: 14px 12px; }
.footer { margin: 2rem 0 0; font-size: .6rem; letter-spacing: .12em; color: var(--text-faint); line-height: 1.8; }

@media (orientation: portrait), (max-width: 900px) {
  .login-root { flex-direction: column; align-items: center; justify-content: flex-start; height: auto; min-height: 100dvh; overflow: visible; }
  .panel { flex: none; width: 100%; max-width: 440px; height: auto; overflow-y: visible; padding: 2.5rem 1.75rem 3rem; align-items: center; text-align: center; }
  .eyebrow-row { justify-content: center; }
  .avatar-wrap { display: block; }
  .portrait-panel { display: none; }
  .auth-block { width: 100%; text-align: left; }
}
@media (orientation: landscape) and (min-width: 901px) {
  .avatar-wrap { display: none; }
  .portrait-panel { display: block; }
}
