/*
  Tailles calées sur la maquette Figma (design width: 1920px).
  clamp(min, valeur/1920*100vw, valeur-figma) => identique au pixel à 1920px de large,
  et réduit proportionnellement en dessous au lieu de paraître surdimensionné.
*/
:root {
  --color-bg: #171717;
  --color-white: #FFFFFF;
  --color-muted: #8C94A5;
  --color-button-bg: #6D6D6D;

  --color-card-bg: #2E2E2E;
  --color-card-desc: #DFDFDF;

  --font-fields: 'fields-display', 'Source Serif 4', Georgia, serif;
  --font-halyard: 'halyard-display', 'Inter', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  font-family: var(--font-halyard);
}

.site-header {
  /* Matches the main site's header exactly: it renders its whole layout at
     80% via CSS zoom, so this is scoped to the header only, not the rest of
     the page. */
  zoom: 0.8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1600px;
  margin: 0 auto 32px;
  padding: 64px 24px 0;
  background: transparent;
}

@media (min-width: 1790px) {
  .site-header {
    max-width: 1760px;
  }
}

.site-header__logo {
  display: block;
  flex-shrink: 0;
  width: clamp(140px, 11.5vw, 220px);
  height: auto;
}

.site-header__logo img {
  display: block;
  width: auto;
  height: clamp(30px, 2.5vw, 47px);
}

@media (min-width: 1790px) {
  .site-header__logo {
    width: 220px;
  }

  .site-header__logo img {
    height: 47px;
  }
}

@media (max-width: 403px) {
  .site-header__logo {
    width: clamp(100px, 30vw, 140px);
  }

  .site-header__logo img {
    height: clamp(24px, 7vw, 30px);
  }
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.83vw, 16px);
}

.site-header__logout-form {
  margin: 0;
  display: flex;
}

.site-header__back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 0.52vw, 10px);
  flex-shrink: 0;
  height: clamp(34px, 2.4vw, 46px);
  padding: clamp(8px, 0.56vw, 12px) clamp(12px, 0.94vw, 18px);
  border-radius: 4px;
  background: transparent;
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 20px;
  font-weight: 300;
  line-height: 26px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.site-header__back-btn--as-form {
  border: none;
  margin: 0;
  cursor: pointer;
}

.site-header__back-btn-icon {
  display: block;
  width: clamp(18px, 1.25vw, 24px);
  height: clamp(18px, 1.25vw, 24px);
}

/* Gray pill button — same style as "Nous contacter" on the main site header */
.site-header__gray-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: clamp(34px, 2.4vw, 46px);
  padding: clamp(8px, 0.56vw, 12px) clamp(12px, 0.94vw, 18px);
  border-radius: 4px;
  background: var(--color-button-bg);
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 20px;
  font-weight: 300;
  line-height: 26px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.site-header__gray-btn .btn__text {
  height: 26px;
}

.site-header__gray-btn:hover .btn__text > span {
  transform: translateY(calc(-100% - 8px));
}

/* Sliding text hover (same mechanic as the main site's header buttons):
   two stacked copies of the label, revealed via translateY on hover. */
.btn__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.btn__text > span {
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* Icon + label pair sliding together as one row (used by back-btn) */
.btn__text > .btn__row {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.52vw, 10px);
}

.site-header__back-btn .btn__text {
  height: 26px;
}

.site-header__back-btn:hover .btn__text > span {
  transform: translateY(calc(-100% - 8px));
}

.site-header__divider {
  zoom: 0.8;
  height: 1px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  background: #CCCCCC;
  background-clip: content-box;
}

@media (min-width: 1790px) {
  .site-header__divider {
    max-width: 1760px;
  }
}

/* Fr/En language switcher — same look as the main site's header dropdown,
   implemented with a native <details> element so no JS is needed. */
.site-header__lang {
  font-family: var(--font-halyard);
  font-size: clamp(16px, 1.15vw, 22px);
  font-weight: 300;
  line-height: 26px;
  color: var(--color-white);
  cursor: pointer;
  position: relative;
}

.site-header__lang-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
}

.site-header__lang-btn::-webkit-details-marker {
  display: none;
}

.site-header__lang-btn::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s ease;
}

.site-header__lang[open] .site-header__lang-btn::after {
  transform: rotate(180deg);
}

.site-header__lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 80px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10010;
}

.site-header__lang-menu li {
  padding: 8px 16px;
  transition: background 0.15s ease;
}

.site-header__lang-menu li:hover {
  background: #F4F7F6;
}

.site-header__lang-menu a {
  display: block;
  color: #0A0D11;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
}

.site-header__lang-menu li.is-selected a {
  font-weight: 500;
}

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(48px, 5vw, 96px);
  padding: clamp(56px, 5.73vw, 110px) 24px clamp(56px, 6.25vw, 120px);
}

.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 0.83vw, 16px);
  text-align: center;
}

.login-hero__title {
  margin: 0;
  color: var(--color-white);
  text-align: center;
  font-family: var(--font-fields);
  font-size: clamp(34px, 4.17vw, 80px);
  font-style: normal;
  font-weight: 400;
  line-height: clamp(46px, 5.73vw, 110px);
  white-space: nowrap;
}

.login-hero__subtitle {
  margin: 0;
  color: var(--color-muted);
  text-align: center;
  font-family: var(--font-halyard);
  font-size: clamp(16px, 1.46vw, 28px);
  font-style: normal;
  font-weight: 300;
  line-height: clamp(20px, 1.67vw, 32px);
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 1.67vw, 32px);
}

.login-form__error {
  margin: 0;
  max-width: clamp(280px, 20.05vw, 385px);
  text-align: center;
  color: #E5A0A0;
  font-family: var(--font-halyard);
  font-size: clamp(13px, 0.83vw, 16px);
  font-weight: 400;
  line-height: 1.4;
}

.login-fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 0.83vw, 16px);
  width: clamp(280px, 20.05vw, 385px);
  max-width: 100%;
  min-width: 250px;
}

.field {
  position: relative;
  width: 100%;
  height: clamp(48px, 3.02vw, 58px);
  padding: clamp(6px, 0.42vw, 8px) clamp(12px, 0.83vw, 16px);
  border: 1px solid var(--color-muted);
  border-radius: 8px;
}

/* Floating label: the label starts centered over the field (acting as a
   placeholder) and floats up to the top edge once the field is focused or
   has a value. Relies on the input coming before the label in the markup
   so the `~` sibling selector can react to :focus/:placeholder-shown. */
.field label {
  position: absolute;
  left: clamp(12px, 0.83vw, 16px);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-halyard);
  font-size: clamp(14px, 1.04vw, 20px);
  font-weight: 300;
  line-height: 1.2;
  color: var(--color-muted);
  pointer-events: none;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease, font-weight 0.15s ease;
}

.field input {
  position: absolute;
  left: clamp(12px, 0.83vw, 16px);
  right: clamp(12px, 0.83vw, 16px);
  bottom: clamp(6px, 0.42vw, 8px);
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: calc(100% - clamp(24px, 1.66vw, 32px));
  font-family: var(--font-halyard);
  font-size: clamp(14px, 1.04vw, 20px);
  font-weight: 300;
  line-height: clamp(16px, 1.15vw, 22px);
  color: var(--color-white);
}

.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label {
  top: clamp(4px, 0.31vw, 6px);
  transform: translateY(0);
  font-size: clamp(11px, 0.73vw, 14px);
  font-weight: 400;
}

.field:focus-within {
  border-color: var(--color-white);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 0.83vw, 16px);
  width: 100%;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  width: clamp(18px, 1.25vw, 24px);
  height: clamp(18px, 1.25vw, 24px);
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--color-muted);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"]:checked {
  background-color: var(--color-button-bg);
  border-color: var(--color-button-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5L6.5 12L13 4.5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 65% 65%;
}

.checkbox-row span {
  flex: 1 0 0;
  font-family: var(--font-halyard);
  font-size: clamp(14px, 0.94vw, 18px);
  font-weight: 300;
  line-height: clamp(15px, 1.04vw, 20px);
  color: var(--color-muted);
}

.login-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(130px, 8.65vw, 166px);
  height: clamp(44px, 2.97vw, 57px);
  padding: clamp(10px, 0.83vw, 16px) clamp(16px, 1.25vw, 24px);
  border: none;
  border-radius: 4px;
  background: var(--color-button-bg);
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: clamp(16px, 1.15vw, 22px);
  font-weight: 300;
  line-height: clamp(18px, 1.35vw, 26px);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
}

.login-form__submit .btn__text {
  height: clamp(18px, 1.35vw, 26px);
}

.login-form__submit:hover .btn__text > span {
  transform: translateY(calc(-100% - 8px));
}

.login-form__forgot {
  font-family: var(--font-halyard);
  font-size: clamp(14px, 0.94vw, 18px);
  font-weight: 300;
  line-height: clamp(15px, 1.04vw, 20px);
  color: var(--color-muted);
  text-decoration: none;
}

.login-form__forgot:hover {
  text-decoration: underline;
}

/* CSS-only modal (shown via the URL fragment matching its id, no JS needed) */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal:target {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal__box {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  background: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.modal__title {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-fields);
  font-size: 28px;
  font-weight: 400;
}

.modal__text {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-halyard);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.4;
}

.modal__close {
  align-self: center;
  text-decoration: none;
}

.admin-btn.modal__close {
  font-weight: 300;
}

.apps-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 3.33vw, 64px);
  padding: clamp(56px, 5.73vw, 110px) 24px clamp(56px, 6.25vw, 120px);
}

.apps-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 0.83vw, 16px);
  text-align: center;
}

.apps-hero__title {
  margin: 0;
  color: var(--color-white);
  text-align: center;
  font-family: var(--font-fields);
  font-size: clamp(34px, 4.17vw, 80px);
  font-style: normal;
  font-weight: 400;
  line-height: clamp(46px, 5.73vw, 110px);
  white-space: nowrap;
}

.apps-hero__subtitle {
  margin: 0;
  color: var(--color-muted);
  text-align: center;
  font-family: var(--font-halyard);
  font-size: clamp(16px, 1.46vw, 28px);
  font-style: normal;
  font-weight: 300;
  line-height: clamp(20px, 1.67vw, 32px);
}

.apps-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(14px, 1.25vw, 24px);
}

.app-card {
  position: relative;
  display: block;
  width: clamp(280px, 23.96vw, 460px);
  height: clamp(200px, 16.04vw, 308px);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-card-bg);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.app-card--entretiens:hover {
  background: #737373;
}

.app-card--assessment:hover {
  background: #7F6961;
}

.app-card__logo {
  position: absolute;
  top: clamp(32px, 3.33vw, 64px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(110px, 10.42vw, 200px);
  height: auto;
  display: block;
}

.app-card__logo-accent {
  fill: #C4A092;
  transition: fill 0.2s ease;
}

.app-card:hover .app-card__logo-accent {
  fill: var(--color-white);
}

.app-card__cta {
  position: absolute;
  top: clamp(14px, 1.28vw, 24.54px);
  right: clamp(14px, 1.25vw, 24px);
  width: clamp(24px, 2.08vw, 40px);
  height: clamp(24px, 2.08vw, 40px);
  border-radius: 9999px;
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.app-card__cta img {
  width: 55%;
  height: 55%;
}

.app-card:hover .app-card__cta,
.app-card:focus-visible .app-card__cta {
  opacity: 1;
}

.app-card__content {
  position: absolute;
  left: clamp(14px, 1.25vw, 24px);
  right: clamp(7px, 0.625vw, 12px);
  bottom: clamp(14px, 1.25vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.42vw, 8px);
}

.app-card__title {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-fields);
  font-size: clamp(16px, 1.15vw, 22px);
  font-weight: 400;
  line-height: clamp(18px, 1.25vw, 24px);
}

.app-card__desc {
  margin: 0;
  color: var(--color-card-desc);
  font-family: var(--font-halyard);
  font-size: clamp(14px, 1.04vw, 20px);
  font-weight: 300;
  line-height: clamp(16px, 1.15vw, 22px);
}

/* ---- Admin panel (no Figma spec — kept consistent with the rest of the app) ---- */

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.admin-page__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.admin-page__title {
  margin: 0;
  color: var(--color-white);
  text-align: center;
  font-family: var(--font-fields);
  font-size: 40px;
  font-weight: 400;
}

.admin-page__subtitle {
  margin: 0;
  color: var(--color-muted);
  text-align: center;
  font-family: var(--font-halyard);
  font-size: 16px;
  font-weight: 300;
}

.admin-flash {
  border: 1px solid var(--color-muted);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-flash__title {
  margin: 0;
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 14px;
  font-weight: 400;
}

.admin-flash__password-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-flash__password {
  margin: 0;
  color: var(--color-white);
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.admin-flash__note {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-halyard);
  font-size: 13px;
  font-weight: 300;
}

.admin-confirm {
  border: 1px solid #E5A0A0;
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-confirm__actions {
  display: flex;
  gap: 12px;
}

.admin-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 24px;
}

.admin-card__title {
  margin: 0 0 16px;
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 18px;
  font-weight: 500;
}

.admin-create-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-create-form__email,
.admin-create-form__name {
  flex: 1 1 260px;
  min-width: 220px;
  height: clamp(48px, 3.02vw, 58px);
}

/* The email/name fields now grow taller on wide screens (same clamp as
   the login page's own fields) — the role select and "Créer" button in
   this same row need to grow by the same amount, or align-items: flex-end
   leaves their tops sitting below the fields' tops. */
.admin-create-form .admin-select,
.admin-create-form .admin-btn {
  height: clamp(48px, 3.02vw, 58px);
}

.admin-select {
  height: 48px;
  padding: 0 36px 0 12px;
  background-color: var(--color-bg);
  appearance: none;
  -webkit-appearance: none;
  color: var(--color-white);
  border: 1px solid var(--color-muted);
  border-radius: 6px;
  font-family: var(--font-halyard);
  font-size: 14px;
}

.admin-select--compact {
  height: 36px;
  padding: 0 30px 0 8px;
  font-size: 13px;
}

.select-wrap {
  position: relative;
  display: inline-flex;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 10px;
  height: 7px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238C94A5' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 10px 7px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.select-wrap--compact .select-arrow {
  right: 8px;
}

.select-wrap:focus-within .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.admin-btn {
  height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 6px;
  background: var(--color-button-bg);
  color: var(--color-white);
  font-family: var(--font-halyard);
  font-size: 14px;
  font-weight: 300;
  line-height: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.admin-btn .btn__text {
  height: 16px;
  align-items: center;
}

.admin-btn:hover .btn__text > span {
  transform: translateY(calc(-100% - 8px));
}

.admin-btn--primary {
  background: var(--color-button-bg);
}

.admin-btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-btn--sm {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 15px;
}

.admin-btn--sm .btn__text {
  height: 15px;
  align-items: center;
}

.admin-btn--danger {
  background: #B23B3B;
}

.admin-btn--danger-text {
  color: #E5A0A0;
  border-color: rgba(229, 160, 160, 0.4);
}

.admin-search {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-search__field {
  flex: 1 1 260px;
  min-width: 220px;
  height: clamp(48px, 3.02vw, 58px);
}

.admin-search__empty {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-family: var(--font-halyard);
  font-size: 14px;
  font-weight: 300;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-halyard);
  font-size: 14px;
  color: var(--color-white);
}

.admin-table th {
  text-align: left;
  color: var(--color-muted);
  font-weight: 400;
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.admin-sort-link {
  color: inherit;
  text-decoration: none;
}

.admin-sort-link:hover {
  color: var(--color-white);
}

.admin-sort-indicator {
  font-size: 10px;
  color: var(--color-muted);
  opacity: 0.6;
}

.admin-sort-indicator--active {
  color: var(--color-white);
  opacity: 1;
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table__subtext {
  color: var(--color-muted);
  font-size: 12px;
}

.admin-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-table__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
