/* =========================================================
   ICAPS — Accès questionnaire jeunes
   Version simplifiée
   Dépend de : app.css
   ========================================================= */


/* =========================================================
   Page
   ========================================================= */

.young-access {
  position: relative;

  min-height: 100vh;

  padding: 48px 22px 28px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  isolation: isolate;

  background:
    radial-gradient(
      circle at 8% 90%,
      rgba(201, 30, 95, 0.07),
      transparent 25%
    ),
    radial-gradient(
      circle at 92% 8%,
      rgba(214, 107, 44, 0.08),
      transparent 23%
    ),
    linear-gradient(
      145deg,
      #f8faf6 0%,
      #f3f8ef 50%,
      #edf5e8 100%
    );
}


/* Grille très légère */

.young-access::before {
  content: "";

  position: absolute;
  inset: 0;

  z-index: -2;

  opacity: 0.28;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.55) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.55) 1px,
      transparent 1px
    );

  background-size: 42px 42px;

  mask-image:
    radial-gradient(
      circle at center,
      rgba(0, 0, 0, 0.75),
      transparent 75%
    );
}


/* =========================================================
   Vague décorative
   ========================================================= */

/* =========================================================
   Vague CNDAPS décorative
   ========================================================= */

.young-access__wave {
  position: absolute;

  width: 750px;
  max-width: none;
  height: auto;

  right: -60px;
  bottom: -70px;

  z-index: -1;

  /* Transforme la vague en blanc */
  filter: brightness(0) invert(1);

  /* Filigrane très léger */
  opacity: 0.42;

  pointer-events: none;
  user-select: none;
}


/* =========================================================
   Carte
   ========================================================= */

.young-access__card {
  width: min(100%, 590px);

  padding:
    clamp(30px, 5vw, 48px)
    clamp(24px, 5vw, 46px);

  border: 1px solid rgba(216, 225, 213, 0.95);
  border-radius: var(--radius-xl);

  background: rgba(255, 255, 255, 0.94);

  box-shadow: var(--shadow-lg);

  backdrop-filter: blur(12px);
}


/* =========================================================
   Header
   ========================================================= */

.young-access__header {
  text-align: center;
}

.young-access__logo {
  display: block;

  width: 142px;
  height: auto;

  margin: 0 auto 34px;
}

.young-access__eyebrow {
  margin: 0 0 10px;

  color: var(--color-icaps-700);

  font-size: 0.72rem;
  font-weight: var(--font-weight-bold);

  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.young-access__header h1 {
  margin: 0;

  font-size: clamp(2.15rem, 6vw, 2.85rem);
  font-weight: var(--font-weight-heavy);

  line-height: 1.05;
  letter-spacing: -0.025em;
}

.young-access__intro {
  max-width: 455px;

  margin: 14px auto 0;

  color: var(--color-muted);

  font-size: 0.94rem;

  line-height: 1.6;
}


/* =========================================================
   Projet
   ========================================================= */

.project-chip {
  width: fit-content;
  max-width: 100%;

  margin: 25px auto 31px;
  padding: 10px 14px;

  display: flex;
  align-items: center;

  gap: 10px;

  border: 1px solid #e1e9dd;
  border-radius: 999px;

  background: var(--color-icaps-50);
}

.project-chip__dot {
  width: 8px;
  height: 8px;

  flex: 0 0 auto;

  border-radius: 50%;

  background: var(--color-icaps-600);

  box-shadow:
    0 0 0 4px rgba(105, 170, 63, 0.10);
}

.project-chip strong,
.project-chip span {
  display: block;
}

.project-chip strong {
  color: var(--color-ink);

  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
}

.project-chip div > span {
  margin-top: 2px;

  color: var(--color-muted);

  font-size: 0.65rem;
}


/* =========================================================
   Code
   ========================================================= */

.young-access .young-access__absent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin: 10px 0 0;
  text-align: left;
  font-size: 0.65rem;
  font-weight: var(--font-weight-light);
  color: var(--color-muted);
  line-height: 1.4;
}

.young-access__absent input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--color-icaps-600);
}

.young-access .code-input:disabled {
  background-color: #f1f4f2;
  color: var(--color-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.young-access__absent input:focus-visible {
  outline: 2px solid var(--color-icaps-600);
  outline-offset: 4px;
  border-radius: 3px;
}

.young-access [hidden] {
  display: none !important;
}

.young-access .young-alert--error {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid #d99a9a;
  border-radius: 10px;
  background: #fff5f5;
  color: #8b2020;
  font-size: 0.8rem;
}

.young-access .young-alert ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.young-access .young-field-error {
  margin: 8px 0;
  color: #8b2020;
  font-size: 0.75rem;
  line-height: 1.4;
}

.young-access .form-control--error {
  border-color: #b83232;
}

.young-access .form-control--error:focus {
  outline: 2px solid #b83232;
  outline-offset: 2px;
}

.young-identification-state {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #d2ddd7;
  border-radius: 10px;
  background: #f5faf7;
  color: var(--color-ink);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: left;
}

.young-identification-state--completed {
  border-color: #d99a9a;
  background: #fff5f5;
}

.young-identification-state p {
  margin: 8px 0 0;
}

.young-identification-state__resume {
  width: 100%;
  margin-top: 12px;
}

.code-fields {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    32px
    minmax(0, 1fr);
  grid-template-areas:
    "label-first . label-second"
    "control-first plus control-second"
    ". . absent";
  align-items: start;
  column-gap: 16px;
  row-gap: 8px;
}

.code-fields__label {
  align-self: end;
  margin: 0;
  color: var(--color-ink);
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.5;
  text-align: center;
}

.code-fields__label--first {
  grid-area: label-first;
}

.code-fields__label--second {
  grid-area: label-second;
}

.code-fields__control {
  width: 100%;
  min-width: 0;
}

.code-fields__control--first {
  grid-area: control-first;
}

.code-fields__control--second {
  grid-area: control-second;
}

.code-fields__absent-row {
  grid-area: absent;
  min-width: 0;
}

.form-group label {
  display: block;

  margin-bottom: 8px;

  color: var(--color-ink);

  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);

  text-align: center;
}

.code-input {
  height: 66px;

  text-align: center;

  font-size: 1.4rem;
  font-weight: var(--font-weight-heavy);

  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.code-input::placeholder {
  color: #b2b8b3;

  font-size: 1.2rem;
  font-weight: var(--font-weight-light);

  letter-spacing: 0.12em;
}

.code-fields__plus {
  grid-area: plus;
  height: 66px;

  display: grid;
  place-items: center;

  color: #abb2ad;

  font-size: 1.3rem;
  font-weight: var(--font-weight-light);
}

.code-help {
  margin: 12px 0 0;

  color: var(--color-muted);

  font-size: 0.7rem;

  text-align: center;

  line-height: 1.45;
}

.code-help strong {
  color: var(--color-ink);

  font-weight: var(--font-weight-bold);
}


/* =========================================================
   Bouton
   ========================================================= */

.young-access-form__submit {
  width: 100%;
  min-height: 58px;

  margin-top: 25px;

  gap: 11px;

  font-size: 0.95rem;
}

.young-access-form__submit svg {
  width: 19px;
  height: 19px;

  fill: none;

  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;

  transition: transform var(--transition-fast);
}

.young-access-form__submit:hover svg {
  transform: translateX(3px);
}


/* =========================================================
   Infos courtes
   ========================================================= */

.young-access__info {
  margin-top: 27px;
  padding-top: 22px;

  display: grid;

  gap: 10px;

  border-top: 1px solid #edf0ec;
}

.info-item {
  display: flex;
  align-items: center;

  gap: 10px;

  color: var(--color-muted);

  font-size: 0.72rem;

  line-height: 1.4;
}

.info-item__icon {
  width: 25px;
  height: 25px;

  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: var(--color-icaps-100);
  color: var(--color-icaps-700);

  font-size: 0.7rem;
  font-weight: var(--font-weight-heavy);
}


/* =========================================================
   Footer
   ========================================================= */

.young-access__footer {
  margin-top: 21px;

  color: #969d98;

  font-size: 0.65rem;

  text-align: center;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 520px) {

  .young-access {
    justify-content: flex-start;

    padding:
      24px
      16px
      22px;
  }

  .young-access__card {
    padding: 28px 20px;

    border-radius: 22px;
  }

  .young-access__logo {
    width: 126px;

    margin-bottom: 28px;
  }

  .young-access__intro {
    font-size: 0.88rem;
  }

  .project-chip {
    margin-bottom: 27px;
  }

  .young-access .code-fields {
    grid-template-columns:
      minmax(0, 1fr)
      24px
      minmax(0, 1fr);

    column-gap: 8px;
    row-gap: 8px;
  }

  .young-access .code-fields__plus {
    height: 60px;

    font-size: 1rem;
  }

  .code-input {
    height: 60px;
  }

}


@media (max-width: 360px) {

  .young-access {
    padding-inline: 10px;
  }

  .young-access__card {
    padding-inline: 16px;
  }

}
