/* makhzony-v90 — the public header's account actions, the Support menu, the centred Sign-in and Team windows and the cue.
   Its own file: the bundled site.css is at its size budget (public-site/tests). */

/* ---------- account actions: who sees what (html[data-auth-state] — site/auth.js) ---------- */
.site-auth-actions { order: 4; display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.site-auth-actions > * { flex-shrink: 0; }
.site-signin, .site-teamlogin, .site-dashboard {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  font: inherit; font-size: 14.5px; font-weight: 800; white-space: nowrap; text-decoration: none; cursor: pointer; }
.site-signin, .site-dashboard { color: #fff; background: var(--pf-gradient, linear-gradient(135deg, #1d4ed8, #0b7bd8)); border: 0; box-shadow: 0 6px 18px rgba(8, 118, 223, .28); }
.site-signin:hover, .site-dashboard:hover { color: #fff; filter: brightness(1.08); }
.site-teamlogin { color: var(--pf-ink, #10233f); background: var(--pf-surface, #fff); border: 1px solid var(--pf-line, #d6deea); }
.site-teamlogin:hover { border-color: var(--pf-blue, #1d6fe0); background: var(--pf-soft, #eef4ff); }
.site-teamlogin .pf-icon, .site-teamlogin svg { width: 18px; height: 18px; flex: none; }
body.dark-mode .site-teamlogin { color: #e8eefb; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); }
.site-signin:focus-visible, .site-teamlogin:focus-visible, .site-dashboard:focus-visible { outline: 3px solid var(--pf-blue, #1d6fe0); outline-offset: 3px; }
html:not([data-auth-state="signed"]) .site-dashboard { display: none; }
html[data-auth-state="signed"] .site-signin, html[data-auth-state="signed"] .site-teamlogin { display: none; }
html[data-auth-state="pending"] .site-auth-actions > :not(.site-account) { visibility: hidden; }   /* no flash while Firebase answers */
.site-auth-actions > .site-account { order: 2; }
/* makhzony-v104: from 768 to 1023 px the two account buttons are tighter (same labels, same 44 px height) so the header's
   controls keep their distance from the logo whatever font the device draws them with (French in a wide fallback font
   left 24 px — tools/test-home-hero-browser.js asks for 40) */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .site-auth-actions { gap: 6px; }
  .site-signin, .site-teamlogin, .site-dashboard { padding: 8px 11px; font-size: 13px; gap: 5px; }
  .site-teamlogin .pf-icon, .site-teamlogin svg { width: 16px; height: 16px; }
}

/* ---------- Support ▾ ---------- */
.site-support { position: relative; display: inline-flex; }
.site-support-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 12px; font-size: 13px !important; background: none; border: 0; color: inherit; font: inherit; font-weight: 700; cursor: pointer; border-radius: 10px; }
.site-support-toggle:hover, .site-support[data-current] .site-support-toggle { color: var(--pf-blue-strong, #0b5bd3); }
.site-support-toggle:focus-visible { outline: 3px solid var(--pf-blue, #1d6fe0); outline-offset: 2px; }
.site-chevron { transition: transform .15s ease; }
.site-support-toggle[aria-expanded="true"] .site-chevron { transform: rotate(180deg); }
.site-support-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 60; min-width: 200px; padding: 6px; display: grid; gap: 2px;
  background: var(--pf-surface, #fff); border: 1px solid var(--pf-line, #d6deea); border-radius: 14px; box-shadow: 0 16px 40px rgba(8, 26, 56, .16); }
.site-support-menu[hidden] { display: none; }
.site-support-menu a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; }
.site-support-menu a::after { content: none !important; }
.site-support-menu a:hover, .site-support-menu a:focus-visible { background: var(--pf-soft, #eef4ff); }
body.dark-mode .site-support-menu { background: #0d2242; border-color: rgba(255, 255, 255, .14); }
body.dark-mode .site-support-menu a:hover { background: rgba(255, 255, 255, .08); }

/* ---------- the phone: the drawer lists the five destinations in their order; Support opens in place ---------- */
@media (max-width: 767px) {
  .site-header > .site-auth-actions { grid-area: login; margin: 0; gap: 4px; direction: rtl; }
  html[dir="ltr"] .site-header > .site-auth-actions { direction: ltr; }
  .site-signin, .site-dashboard { min-height: 44px; padding: 6px 11px; font-size: 12.5px; }
  .site-teamlogin { min-height: 44px; min-width: 44px; padding: 6px; }
  .site-teamlogin-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* signed in on a phone: «Dashboard» and the account menu's avatar alone (its label stays for screen readers) */
  .site-auth-actions > .site-account summary > span:not(.site-account-avatar) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-auth-actions > .site-account summary { padding: 2px; gap: 0; min-width: 44px; min-height: 44px; justify-content: center; }
  .site-header > .site-nav.is-open { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-header > .site-nav.is-open > a, .site-header > .site-nav.is-open .site-support-toggle { font-size: 15px !important; min-height: 46px; justify-content: space-between; padding-inline: 12px; }
  .site-header > .site-nav .site-support { display: block; }
  .site-header > .site-nav .site-support-toggle { width: 100%; }
  .site-header > .site-nav .site-support-menu { position: static; min-width: 0; box-shadow: none; border: 0; padding: 0 12px 4px; background: transparent; }
}

@media (max-width: 360px) {
  .site-signin, .site-dashboard { padding: 6px 8px; font-size: 11.5px; }
  .site-header > .site-auth-actions { gap: 3px; }
}
@media (max-width: 340px) {
  .site-signin, .site-dashboard { padding: 6px 6px; font-size: 11px; letter-spacing: -.1px; }
}

/* ---------- the windows (a native <dialog>: focus stays inside; Escape is handled) ---------- */
html.pf-am-open { overflow-y: scroll; }   /* the body is pinned in place while a window is open (site/auth-modal.js lock) */
dialog.pf-am { position: fixed; inset: 0; margin: auto; padding: 0; border: 0; background: transparent; color: inherit; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
  overflow: visible; }
dialog.pf-am::backdrop { background: rgba(8, 20, 42, .38); -webkit-backdrop-filter: blur(7px) saturate(110%); backdrop-filter: blur(7px) saturate(110%); }
.pf-am-card { position: relative; box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 28px 20px; background: var(--pf-surface, #fff); color: var(--pf-ink, #10233f); border: 1px solid var(--pf-line, #d6deea); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(6, 18, 40, .32), 0 2px 6px rgba(6, 18, 40, .08); font-size: 15px; line-height: 1.55;
  padding-bottom: max(20px, env(safe-area-inset-bottom)); }
body.dark-mode .pf-am-card { background: #0d2242; color: #e8eefb; border-color: rgba(255, 255, 255, .14); }
.pf-am-x { position: absolute; top: 12px; inset-inline-end: 12px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: transparent; color: inherit; border: 0; border-radius: 12px; cursor: pointer; opacity: .75; }
.pf-am-x:hover, .pf-am-x:focus-visible { opacity: 1; background: rgba(8, 26, 56, .07); }
.pf-am-head { text-align: center; margin: 4px 0 18px; }
.pf-am-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 14px; }
body.dark-mode .pf-am-logo { content: url('/site/brand/posfield-symbol-on-dark.png?v=104'); }
.pf-am-teamicon { display: inline-block; width: 52px; height: 52px; border-radius: 16px; background: var(--pf-soft, #eef4ff)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d6fe0' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.5 19c.6-3.2 2.8-5 5.5-5s4.9 1.8 5.5 5'/%3E%3Ccircle cx='17' cy='9' r='2.6'/%3E%3Cpath d='M15.8 14.2c2.4.2 4 1.8 4.7 4.8'/%3E%3C/svg%3E") center / 30px no-repeat; }
.pf-am-title { margin: 10px 0 4px; font-size: 21px; font-weight: 800; color: inherit; }
.pf-am-lead { margin: 0; color: var(--pf-muted, #51627a); font-size: 14.5px; }
body.dark-mode .pf-am-lead, body.dark-mode .pf-am-note, body.dark-mode .pf-am-foot { color: #b8c6dc; }
.pf-am-provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; margin: 0 0 10px; padding: 10px 14px;
  background: var(--pf-surface, #fff); color: var(--pf-ink, #10233f); border: 1px solid var(--pf-line, #d6deea); border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.pf-am-provider:hover { border-color: var(--pf-blue, #1d6fe0); background: var(--pf-soft, #eef4ff); }
.pf-am-provider[hidden] { display: none; }
body.dark-mode .pf-am-provider { background: rgba(255, 255, 255, .06); color: #e8eefb; border-color: rgba(255, 255, 255, .2); }
.pf-am-ico { display: inline-flex; }
.pf-am-or { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; color: var(--pf-muted, #51627a); font-size: 13px; }
.pf-am-or::before, .pf-am-or::after { content: ''; flex: 1; height: 1px; background: var(--pf-line, #d6deea); }
.pf-am-or[hidden] { display: none; }
.pf-am-form { display: grid; gap: 10px; }
.pf-am-field { display: grid; gap: 5px; font-size: 13.5px; font-weight: 700; }
.pf-am-field[hidden] { display: none; }
.pf-am-inputwrap { position: relative; display: flex; }
.pf-am-input { box-sizing: border-box; width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 16px; color: inherit; background: var(--pf-surface-2, #f7f9fd);
  border: 1px solid var(--pf-line, #d6deea); border-radius: 12px; }
.pf-am-inputwrap .pf-am-input { padding-inline-end: 48px; }
.pf-am-input:focus { outline: 0; border-color: var(--pf-blue, #1d6fe0); box-shadow: 0 0 0 3px rgba(29, 111, 224, .18); }
body.dark-mode .pf-am-input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }
.pf-am-eye { position: absolute; inset-block: 0; inset-inline-end: 4px; margin: auto 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: var(--pf-muted, #51627a); cursor: pointer; border-radius: 10px; }
.pf-am-eye[aria-pressed="true"] { color: var(--pf-blue, #1d6fe0); }
.pf-am-link { padding: 4px 2px; min-height: 36px; background: none; border: 0; color: var(--pf-blue-strong, #0b5bd3); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
body.dark-mode .pf-am-link { color: #8cc4ff; }
.pf-am-forgot { justify-self: start; font-size: 13.5px; }
.pf-am-link[hidden] { display: none; }
.pf-am-status { margin: 0; min-height: 0; color: #b42318; font-size: 14px; font-weight: 600; }
.pf-am-status:empty { display: none; }
body.dark-mode .pf-am-status { color: #ffb4a8; }
.pf-am-done { margin: 0; padding: 10px 12px; border-radius: 12px; background: #e9f7ef; color: #0f5c34; font-size: 14px; }
body.dark-mode .pf-am-done { background: rgba(32, 160, 96, .16); color: #b9f0cf; }
.pf-am-note { margin: 2px 0 0; color: var(--pf-muted, #51627a); font-size: 13.5px; }
.pf-am-primary { min-height: 48px; margin-top: 4px; padding: 10px 16px; color: #fff; background: var(--pf-gradient, linear-gradient(135deg, #1d4ed8, #0b7bd8)); border: 0; border-radius: 12px;
  font: inherit; font-weight: 800; font-size: 15.5px; cursor: pointer; }
.pf-am-primary:disabled { opacity: .7; cursor: progress; }
.pf-am-foot { margin: 14px 0 0; text-align: center; color: var(--pf-muted, #51627a); font-size: 14px; }
.pf-am-cancel { display: block; width: 100%; min-height: 44px; margin-top: 8px; background: none; border: 0; color: var(--pf-muted, #51627a); font: inherit; font-weight: 700; cursor: pointer; border-radius: 12px; }
.pf-am-cancel:hover { background: rgba(8, 26, 56, .05); }
:is(.pf-am-x, .pf-am-provider, .pf-am-primary, .pf-am-link, .pf-am-cancel, .pf-am-eye):focus-visible { outline: 3px solid var(--pf-blue, #1d6fe0); outline-offset: 2px; }
@media (max-width: 480px) {
  .pf-am-card { width: calc(100vw - 24px); padding: 22px 18px 16px; border-radius: 18px; }
  dialog.pf-am { max-width: calc(100vw - 24px); }
}

/* ---------- «Sign in» is here: one short pulse after the Team window was closed by mistake ---------- */
@keyframes pf-am-cue { 0% { box-shadow: 0 0 0 0 rgba(29, 111, 224, .55); transform: scale(1); } 35% { transform: scale(1.06); }
  70% { box-shadow: 0 0 0 14px rgba(29, 111, 224, 0); transform: scale(1); } 100% { box-shadow: 0 0 0 0 rgba(29, 111, 224, 0); } }
.site-signin.pf-am-cue { animation: pf-am-cue 1.1s ease-out 1; outline: 3px solid rgba(255, 196, 0, .95); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .site-signin.pf-am-cue { animation: none; }
  .site-chevron { transition: none; }
}

/* makhzony-v104: «Ouvrir la boutique» is the longest signed-in label; on the narrowest phones it stays inside the bar */
@media (max-width: 359.98px) {
  .site-auth-actions .site-dashboard { padding: 4px 8px; font-size: 11.5px; line-height: 1.15; white-space: normal; text-align: center; max-width: 86px; }
  .site-header > .site-auth-actions { gap: 3px; }
}
