/* ============================================================
   MÉRIDIAN — Compte client (authentification, inscription, espace compte)
   Chargé via stylesheets.tpl sur les pages client uniquement.
   Reprend la maquette MÉRIDIAN (auth + account) et habille le markup
   de formulaire natif PrestaShop (.form-control, .custom-checkbox, …).
   ============================================================ */

.mrd-account { padding-block: clamp(32px, 5vw, 64px); }
.mrd-acc-narrow { max-width: 1080px; margin-inline: auto; }

/* ---------- Titres ---------- */
.mrd-acc-title { font-family: var(--font-display); font-weight: 500; line-height: 1; font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -0.01em; }
.mrd-acc-lead { color: var(--ink-soft); font-size: 16px; margin-top: 12px; max-width: 540px; }

/* ============================================================
   Champs de formulaire (markup PrestaShop) — look MÉRIDIAN
   ============================================================ */
.mrd-account .form-group.row { display: block; margin: 0 0 18px; }
.mrd-account .form-control-label {
  display: block; width: auto; max-width: none; text-align: left; padding: 0; margin: 0 0 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.4;
}
.mrd-account .form-control-label.required::after { content: " *"; color: var(--sale); }
.mrd-account .form-control-label .option { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-faint); margin-left: 6px; }
.mrd-account .js-input-column { width: 100%; padding: 0; }

.mrd-account .form-control,
.mrd-account input[type="text"], .mrd-account input[type="email"], .mrd-account input[type="password"],
.mrd-account input[type="tel"], .mrd-account input[type="number"], .mrd-account input[type="date"],
.mrd-account select, .mrd-account textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--surface); font-family: var(--font-sans); font-size: 14.5px; color: var(--ink);
  outline: none; transition: border-color .2s; box-shadow: none;
}
.mrd-account .form-control:focus,
.mrd-account input:focus, .mrd-account select:focus, .mrd-account textarea:focus { border-color: var(--ink); }
.mrd-account .has-error .form-control,
.mrd-account .has-error input, .mrd-account .has-error select { border-color: var(--sale); }
.mrd-account textarea.form-control { min-height: 120px; resize: vertical; }

.mrd-account select.form-control, .mrd-account select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23736b62' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}

/* mot de passe : champ + bouton afficher */
.mrd-account .input-group { position: relative; display: block; }
.mrd-account .input-group .form-control { padding-right: 72px; }
.mrd-account .input-group-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.mrd-account .input-group-btn .btn {
  background: none; border: 0; color: var(--ink-soft); padding: 8px 10px; min-width: 0;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.mrd-account .input-group-btn .btn:hover { color: var(--ink); background: none; }
.mrd-account .form-control-comment { display: block; margin-top: 5px; font-size: 11.5px; color: var(--ink-faint); }

/* date de naissance (3 selects) */
.mrd-account .js-parent-focus select { display: inline-block; width: auto; min-width: 90px; margin-right: 8px; }

/* titre (M./Mme) en boutons radio inline */
.mrd-account .form-control-valign { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mrd-account .radio-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink); margin: 0; }
.mrd-account .custom-radio { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line); border-radius: 50%; }
.mrd-account .custom-radio input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mrd-account .custom-radio span { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .2s; }
.mrd-account .custom-radio input:checked + span { transform: scale(1); }
.mrd-account .custom-radio input:checked ~ span, .mrd-account .radio-inline input:checked + .custom-radio { border-color: var(--ink); }

/* cases à cocher (newsletter / RGPD / conditions) */
.mrd-account .custom-checkbox { display: block; margin-bottom: 4px; }
.mrd-account .custom-checkbox label { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; margin: 0; }
.mrd-account .custom-checkbox input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; margin-top: 1px;
  width: 19px; height: 19px; border: 1.5px solid var(--line); border-radius: 2px; background: transparent; cursor: pointer; transition: all .2s; position: relative;
}
.mrd-account .custom-checkbox input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
.mrd-account .custom-checkbox .checkbox-checked { display: none; position: absolute; width: 19px; height: 19px; pointer-events: none; }
.mrd-account .custom-checkbox input[type="checkbox"]:checked + .checkbox-checked { display: block; }
.mrd-account .custom-checkbox .checkbox-checked path { fill: var(--bg); }
.mrd-account .custom-checkbox .checkbox-txt { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.mrd-account .custom-checkbox a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* messages d'erreur de champ */
.mrd-account .help-block { list-style: none; margin: 7px 0 0; padding: 0; color: var(--sale); font-size: 12.5px; }

/* pied de formulaire + boutons natifs */
.mrd-account .form-footer { margin-top: 26px; }
.mrd-account .btn-primary, .mrd-account .form-control-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 16px 30px; border-radius: 2px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg);
  transition: all .4s var(--ease); white-space: nowrap;
}
.mrd-account .btn-primary:hover, .mrd-account .form-control-submit:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mrd-account .forgot-password { margin-top: 8px; font-size: 12.5px; }
.mrd-account .forgot-password a { color: var(--ink-soft); }
.mrd-account .forgot-password a:hover { color: var(--ink); }
.mrd-account hr { border: 0; border-top: 1px solid var(--line-soft); margin: 24px 0; }

/* ============================================================
   AUTH — connexion + inscription
   ============================================================ */
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.auth-card { border: 1px solid var(--line); border-radius: 4px; padding: clamp(24px, 3vw, 38px); }
.auth-card-alt { background: var(--bg-2); }
.auth-card-h { font-size: 19px; font-weight: 600; margin-bottom: 16px; }
.auth-card p.auth-card-intro { color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; margin-bottom: 24px; }

.auth-bullets { display: grid; gap: 13px; margin: 0 0 28px; padding: 0; list-style: none; }
.auth-bullets li { display: flex; gap: 11px; align-items: center; font-size: 14px; }
.auth-bullets li svg { color: var(--accent); flex-shrink: 0; }

/* inscription : formulaire seul, largeur de lecture confortable */
.auth-register { max-width: 600px; }

/* ============================================================
   ACCOUNT — coquille (sidebar + contenu) partagée par les sous-pages
   ============================================================ */
.account-welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.account-welcome .mrd-acc-sub { color: var(--ink-soft); margin-top: 8px; font-size: 14.5px; }

.account-grid { display: grid; grid-template-columns: 250px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.account-side { position: sticky; top: 92px; }

.account-user { display: flex; gap: 13px; align-items: center; padding-bottom: 18px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.account-user .tag { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; flex-shrink: 0; text-transform: uppercase; }
.account-user .hi { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.account-user .nm { font-size: 14.5px; font-weight: 600; }

.account-nav { display: flex; flex-direction: column; gap: 2px; }
.account-link { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 13px 14px; border-radius: 3px; color: var(--ink-soft); font-size: 14px; transition: background .2s, color .2s; }
.account-link span { flex: 1; }
.account-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.account-link svg path { fill: currentColor; }
.account-link:hover { background: color-mix(in oklch, var(--ink) 4%, transparent); color: var(--ink); }
.account-link.is-active { background: var(--ink); color: var(--bg); }
.account-count { flex: none !important; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ------------------------------------------------------------
   Liens de modules injectés dans la sidebar via le hook
   displayCustomerAccount — chaque module a son propre markup :
     • wishlist PrestaTheme : <a class="col-… link"><span class="link-item"><svg stroke="#000"><span>…</span></span></a>
     • psgdpr (RGPD)        : <a class="col-…"><span class="link-item"><i class="material-icons">account_box</i> …</span></a>
     • ps_emailalerts       : <li><a>…</a></li>
   On les normalise pour qu'ils s'alignent visuellement sur .account-link.
   ------------------------------------------------------------ */
.account-nav > li { list-style: none; width: 100%; margin: 0; }
.account-nav > a:not(.account-link),
.account-nav > li > a {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  /* neutralise les classes col-* de bootstrap (compat.css) qui brident
     la largeur/hauteur des ancres injectées dans la nav en flex-column */
  flex: 0 0 auto; max-width: 100%; float: none;
  padding: 13px 14px; border-radius: 3px; color: var(--ink-soft);
  font-size: 14px; line-height: 1.3; transition: background .2s, color .2s;
}
.account-nav > a:not(.account-link):hover,
.account-nav > li > a:hover { background: color-mix(in oklch, var(--ink) 4%, transparent); color: var(--ink); }

/* wrapper interne <span class="link-item"> (wishlist + psgdpr) */
.account-nav .link-item { display: flex; align-items: center; gap: 13px; width: 100%; min-width: 0; }
.account-nav .link-item > span { flex: 1; min-width: 0; }

/* icône SVG fournie par le module (wishlist : tracé, pas de remplissage) */
.account-nav .link-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.account-nav .link-item svg [stroke] { stroke: currentColor; }
.account-nav .link-item svg [fill]:not([fill="none"]) { fill: currentColor; }

/* psgdpr : la police material-icons n'existe pas dans MÉRIDIAN → on masque la
   ligature « account_box » qui s'afficherait en clair, puis on injecte une icône */
.account-nav .material-icons { display: none; }
.account-nav #psgdpr-link .link-item::before,
.account-nav > li > a::before {
  content: ""; width: 18px; height: 18px; flex-shrink: 0; background: currentColor;
  -webkit-mask: var(--mrd-acc-ic) center / 18px 18px no-repeat;
          mask: var(--mrd-acc-ic) center / 18px 18px no-repeat;
}
/* bouclier (RGPD / données personnelles) */
.account-nav #psgdpr-link .link-item::before {
  --mrd-acc-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
}
/* cloche (alertes e-mail) */
.account-nav > li > a::before {
  --mrd-acc-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.73 21a2 2 0 0 1-3.46 0'/%3E%3C/svg%3E");
}

.account-content { min-width: 0; }
.account-sec-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 30px); margin-bottom: 6px; }
.account-sec-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; }

/* tuiles du tableau de bord */
.account-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.account-tile { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 4px; padding: 22px; display: flex; flex-direction: column; gap: 6px; color: inherit; transition: border-color .25s, transform .25s, box-shadow .25s; }
.account-tile:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-soft); }
.account-tile-ic { color: var(--accent); margin-bottom: 8px; }
.account-tile-ic svg { width: 22px; height: 22px; }
.account-tile-name { font-size: 15px; font-weight: 600; }
.account-tile-desc { color: var(--ink-soft); font-size: 13px; }
.account-tile-arrow { position: absolute; top: 20px; right: 20px; color: var(--ink-faint); transition: transform .25s var(--ease), color .25s; }
.account-tile:hover .account-tile-arrow { transform: translateX(3px); color: var(--ink); }

/* tableaux/contenus natifs (historique, avoirs, retours…) dans la coquille */
.account-content table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; font-size: 14px; }
.account-content table th { background: var(--bg-2); text-align: left; padding: 14px 16px; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.account-content table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.account-content table tr:last-child td { border-bottom: 0; }

/* cartes d'adresses natives */
.account-content .address { border: 1px solid var(--line); border-radius: 4px; padding: 22px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-side { position: static; }
  .account-user { display: none; }
  .account-nav { flex-direction: row; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
  .account-link,
  .account-nav > a:not(.account-link),
  .account-nav > li > a { width: auto; border: 1px solid var(--line); padding: 9px 14px; }
  .account-nav > li { width: auto; }
  .account-link span,
  .account-nav .link-item, .account-nav .link-item > span { flex: none; width: auto; }
  .account-link.is-active { border-color: var(--ink); }
  .account-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .account-tiles { grid-template-columns: 1fr; }
}
