/* stage.fr : espace étudiant, connexion, favoris et encadré d'alerte. Mobile d'abord.
   S'appuie sur les variables et les boutons de site.css. */

/* Bouton cœur (cartes d'offre et page offre) -------------------------------------------- */

.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 10px; margin-left: auto;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--petrol); text-decoration: none; font: inherit; font-weight: 700; cursor: pointer;
}
.fav-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.fav-btn svg { flex: none; }
.fav-btn.is-saved { color: var(--ink); }
.fav-btn.is-saved svg path { fill: var(--mint); stroke: var(--ink); }
.fav-btn--wide { margin-left: 0; border-color: var(--line-strong); padding: 0 18px; }
.fav-btn__label-on { display: none; }
.fav-btn.is-saved .fav-btn__label-on { display: inline; }
.fav-btn.is-saved .fav-btn__label-off { display: none; }

/* Encadré "Recevoir ces offres par e-mail" ----------------------------------------------- */

.alert-box {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center;
  background: var(--petrol); color: var(--on-dark); border-radius: var(--radius-lg); padding: 18px;
}
.alert-box__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.alert-box__text .small { color: var(--on-dark-muted); }
.alert-box__title { font-family: var(--font-head); font-weight: 600; font-size: 19px; line-height: 1.25; }
.alert-box__form { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; }
.alert-box__row { display: flex; gap: 8px; }
.alert-box__row .input { flex: 1; min-width: 0; }
.alert-box .check { color: var(--on-dark-muted); }
.alert-box .check a { color: var(--on-dark); }

/* Champs de formulaire ------------------------------------------------------------------ */

.input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--white); color: var(--petrol);
  font: inherit; font-size: 16px;
}
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--mint-soft); }
.input:disabled { background: var(--grey-soft); color: var(--muted); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { appearance: auto; }
.input--file { padding: 10px; background: var(--bg); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.field__label { font-weight: 700; font-size: 15px; padding: 0; }
.field__help { font-size: 14px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); }
.check--small { font-size: 13px; }
.check--small input { width: 18px; height: 18px; }
.check--box {
  align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--white);
}
.check--box:has(input:checked) { border-color: var(--ink); background: var(--mint-soft); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px; }
.check-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); max-height: 340px; overflow-y: auto; padding: 2px; }
.check-grid--one { grid-template-columns: 1fr; }

.acc-form { display: flex; flex-direction: column; gap: 18px; }
.acc-form--narrow { max-width: 720px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.acc-actions--center { justify-content: center; }
.acc-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-inline .input { flex: 1 1 220px; width: auto; }

.btn--danger { background: #B3261E; color: var(--white); }
.btn--danger:hover { background: #8C1D18; color: var(--white); }
.link-button {
  border: 0; background: none; padding: 8px 0; min-height: 44px; font: inherit; font-size: 15px;
  color: var(--muted); text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: #B3261E; }

/* Messages ---------------------------------------------------------------------------- */

.acc-error {
  padding: 12px 14px; border-radius: var(--radius-sm); background: #FDECEA; border: 1px solid #F1B8B2;
  color: #7A1C16; font-size: 15px;
}
.acc-error ul { list-style: disc; padding-left: 20px; }
.acc-flash {
  padding: 12px 14px; border-radius: var(--radius-sm); background: var(--mint-soft);
  border: 1px solid #9FE3C9; font-weight: 500;
}
.acc-banner {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius-lg);
  background: var(--warning-bg); border: 1px solid var(--warning-line);
}

/* Pages simples (connexion, messages) ---------------------------------------------------- */

.acc-narrow { max-width: 560px; padding-top: 28px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 14px; }
.acc-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.acc-card--center { align-items: center; text-align: center; }
.acc-card__title { font-size: 20px; line-height: 1.3; }
.acc-title { font-family: var(--font-head); font-weight: 600; font-size: 26px; line-height: 1.15; }
.acc-lead { color: var(--muted); font-size: 17px; }
.acc-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  border-radius: 16px; background: var(--blue-soft); color: var(--petrol);
}
.acc-tone--success .acc-icon { background: var(--mint-soft); color: var(--ink); }
.acc-tone--warning .acc-icon { background: var(--warning-bg); color: #8A5A00; }
.acc-aside { text-align: center; color: var(--muted); }
.acc-password summary { cursor: pointer; font-weight: 700; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.acc-password .field { margin-top: 6px; }
.acc-perks { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: var(--bg); font-size: 15px; }
.acc-perks li { display: flex; gap: 10px; align-items: baseline; }
.acc-perks li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); transform: translateY(-1px); }
.acc-list { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.acc-login .eyebrow { margin-bottom: -6px; }

/* Navigation de l'espace ---------------------------------------------------------------- */

.acc-nav { background: var(--white); border-bottom: 1px solid var(--line); }
.acc-nav__inner { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.acc-nav__list { display: flex; flex-wrap: wrap; gap: 0 18px; flex: 1; min-width: 0; }
.acc-nav__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0; font-size: 15px;
  color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 500;
}
.acc-nav__link:hover { color: var(--petrol); }
.acc-nav__link[aria-current="page"] { color: var(--petrol); font-weight: 700; border-bottom-color: var(--mint); }
.acc-nav__button { border-top: 0; border-left: 0; border-right: 0; background: none; font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }

/* Tableau de bord ---------------------------------------------------------------------- */

.acc-page { padding-top: 24px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 20px; }
.acc-head { display: flex; flex-direction: column; gap: 8px; }
.acc-head--row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.acc-h1 { font-family: var(--font-head); font-weight: 600; font-size: 27px; line-height: 1.12; }
.acc-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.acc-grid--even > * { flex: 1 1 320px; }
.acc-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.acc-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.profile-card { gap: 20px; }
.profile-card__head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 999px; background: var(--mint-soft); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 600; font-size: 21px;
}
.profile-card__who { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-card__name { font-size: 22px; line-height: 1.2; }
.profile-card__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; margin: 0; }
.profile-card__facts dt { font-size: 13px; color: var(--muted); }
.profile-card__facts dd { margin: 0; font-weight: 700; }
.profile-card__strengths { display: flex; flex-direction: column; gap: 8px; }
.profile-card__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; font-size: 14px; background: var(--grey-soft); padding: 6px 12px; border-radius: 999px; }
.tag--green { font-weight: 700; color: var(--green); background: #E1F2EA; }
.tag--warning { font-weight: 700; color: #7A4F00; background: var(--warning-bg); align-self: flex-start; }

.vis-card {
  background: var(--petrol); color: var(--on-dark); border-radius: 22px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.vis-card fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vis-card__title { font-weight: 700; font-size: 20px; padding: 0; margin-bottom: 4px; }
.vis-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; cursor: pointer;
  border: 1px solid var(--petrol-line); border-radius: 12px;
}
.vis-option input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--mint); }
.vis-option > span { display: flex; flex-direction: column; }
.vis-option__help { font-size: 14px; color: var(--on-dark-muted); }
.vis-option:has(input:checked) { border: 2px solid var(--mint); background: #0A4A60; padding: 11px; }
.vis-option:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.vis-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--on-dark-muted); cursor: pointer; }
.vis-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--mint); }
.vis-consent[hidden] { display: none; }
.vis-card__note { font-size: 14px; color: var(--on-dark-muted); }

.stats-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stats-card > div { display: flex; flex-direction: column; }
.stats-card__value { font-family: var(--font-head); font-size: 25px; font-weight: 600; }

.next-card { background: var(--grey-soft); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.next-card__title { font-size: 18px; }
.next-card p { font-size: 15px; }

.acc-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.acc-tool {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none;
}
.acc-tool:hover { border-color: var(--ink); }

/* Listes : alertes, candidatures, CV, favoris ------------------------------------------- */

.alert-list, .app-list { display: flex; flex-direction: column; gap: 12px; }
.alert-item { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.alert-item__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-item__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.alert-item--off { opacity: 0.7; }

.app-item { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.app-item__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-item__title { font-weight: 700; font-size: 17px; }
.status { font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--blue-soft); white-space: nowrap; }
.status--interview { background: var(--mint-soft); color: var(--ink); }
.status--offer { background: #E1F2EA; color: var(--green); }
.status--rejected { background: var(--grey-soft); color: var(--muted); }

.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-list__item { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.file-list__item a { font-weight: 700; overflow-wrap: anywhere; }

.fav-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fav-item .job-card { flex: 1; }
.fav-item--expired .job-card { opacity: 0.7; }
.fav-item__remove { align-self: flex-end; }

.acc-info { gap: 10px; }

@media (min-width: 640px) {
  .acc-card { padding: 28px; }
  .acc-title { font-size: 30px; }
  .alert-box { padding: 22px 26px; }
}

@media (min-width: 960px) {
  .acc-page { padding-top: 40px; padding-bottom: 32px; gap: 28px; }
  .acc-h1 { font-size: 36px; }
  .acc-narrow { padding-top: 48px; }
  .avatar { width: 72px; height: 72px; }
  .profile-card__name { font-size: 24px; }
  .vis-card { padding: 26px; }
}

/* Petit écran : menu de l'espace sur une ligne qui défile, et la carte "Qui peut voir mon profil ?"
   juste sous le profil (comme sur la maquette), avant les raccourcis. */
@media (max-width: 860px) {
  .acc-nav__inner { flex-wrap: nowrap; gap: 12px; }
  .acc-nav__list {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-left: -4px; padding-left: 4px;
  }
  .acc-nav__list::-webkit-scrollbar { display: none; }
  .acc-nav__list:not(.is-end) {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
  .acc-nav__list li { flex: none; white-space: nowrap; }
  .acc-nav__logout { flex: none; }
  .acc-grid--dash { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 16px; }
  .acc-grid--dash > .acc-main, .acc-grid--dash > .acc-side { display: contents; }
  .acc-grid--dash > .acc-main > * { order: 3; }
  .acc-grid--dash > .acc-side > * { order: 4; }
  .acc-grid--dash #profil-titre, .acc-grid--dash .profile-card { order: 1; }
  .acc-grid--dash .vis-card { order: 2; }
}
