/* =============================================================================
   PAVELYS — Panneau « Se connecter / S'inscrire » de l'en-tête
   Chargé uniquement pour les visiteurs non connectés (voir functions.php).
   ========================================================================== */

.pavelys-auth {
    position: relative;
    display: flex;
    align-items: center;
}

/* Le bouton reprend .user-account-btn.logged-out (style.css) ; on n'ajoute ici
   que ce qui est propre au comportement « ouvre un panneau ». */
.pavelys-auth-toggle {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.2;
}

.auth-caret {
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform .2s ease;
}

.pavelys-auth.is-open .auth-caret {
    transform: rotate(180deg);
}

/* ── Panneau ─────────────────────────────────────────────────────────────── */
.pavelys-auth-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    width: 320px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    box-sizing: border-box;
    background: #333338;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .32);
    color: #fff;
    font-family: var(--font-sans, 'Inter', 'Segoe UI', system-ui, sans-serif);
    animation: pavelysAuthIn .16s ease-out;
}

.pavelys-auth-panel[hidden] {
    display: none;
}

@keyframes pavelysAuthIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Petite flèche vers le bouton */
.pavelys-auth-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 26px;
    width: 12px;
    height: 12px;
    background: #333338;
    transform: rotate(45deg);
}

.auth-view[hidden] {
    display: none;
}

.auth-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

/* ── Bouton orange « S'inscrire gratuitement ici » ───────────────────────── */
.auth-switch {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease;
}

.auth-switch--cta {
    margin-bottom: 14px;
    background: #f0a500;
    color: #1a1a1a;
}

.auth-switch--cta:hover {
    filter: brightness(1.07);
}

.auth-switch--back {
    margin-top: 12px;
    background: transparent;
    color: #ffd68a;
    font-weight: 600;
    font-size: 13px;
    text-decoration: underline;
    padding: 4px 0 0;
}

.auth-switch--back:hover {
    color: #fff;
}

/* ── Champs ──────────────────────────────────────────────────────────────── */
.auth-field {
    margin-bottom: 10px;
}

.auth-grid {
    display: flex;
    gap: 8px;
}

.auth-grid .auth-field {
    flex: 1 1 0;
    min-width: 0;
}

.pavelys-auth-panel label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #f2f2f2;
}

.pavelys-auth-panel input[type="text"],
.pavelys-auth-panel input[type="email"],
.pavelys-auth-panel input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 14px;
}

.pavelys-auth-panel input:focus {
    outline: 2px solid #f0a500;
    outline-offset: 1px;
}

.pavelys-auth-panel input.has-error {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, .35);
}

.auth-hint {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: #bdbdbd;
}

/* ── Ligne « rester connecté » / « mot de passe oublié » ─────────────────── */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 6px 0 10px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: #e0e0e0;
    cursor: pointer;
}

.auth-remember input {
    margin: 0;
    accent-color: #f0a500;
}

.auth-lost {
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.auth-lost:hover {
    text-decoration: underline;
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.auth-msg {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.35;
    color: #ffb4b4;
}

.auth-msg:empty {
    display: none;
}

.auth-msg.is-ok {
    color: #8ee6a8;
}

/* ── Boutons de validation ───────────────────────────────────────────────── */
.auth-submit {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 4px;
    background: var(--c-green, #327c32);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter .15s ease;
}

.auth-submit:hover {
    filter: brightness(1.1);
}

.auth-submit[disabled] {
    opacity: .65;
    cursor: default;
}

.auth-submit.is-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    vertical-align: -1px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pavelysAuthSpin .7s linear infinite;
}

@keyframes pavelysAuthSpin {
    to { transform: rotate(360deg); }
}

/* ── Bouton Google ───────────────────────────────────────────────────────── */
.auth-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    background: #fff;
    color: #3c4043;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow .15s ease;
}

.auth-google:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
    color: #3c4043;
}

.auth-google.is-unconfigured {
    opacity: .8;
    cursor: not-allowed;
}

.auth-google-icon {
    flex-shrink: 0;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .pavelys-auth-panel {
        width: calc(100vw - 20px);
        right: -6px;
    }

    .auth-grid {
        display: block;
    }
}

/* =============================================================================
   GARDE-FOUS DE CASCADE

   Le panneau est imprimé dans l'en-tête, donc il vit à l'intérieur de pages qui
   ont déjà leurs propres styles globaux. Deux collisions constatées :

   1. .custom-categories-menu (style.css) est en `z-index: 9999 !important` :
      la barre marron des catégories passait AU-DESSUS du panneau et masquait
      le premier champ ainsi que le bouton d'inscription.

   2. assets/css/my-account.css cible « .woocommerce-account form label » et
      « .woocommerce-account form button[type="submit"] » (ce dernier en
      !important). Sur la page Mon compte, nos libellés passaient donc en
      majuscules grises et le bouton « Se Connecter » repassait en marron
      arrondi pilule.

   Ces sélecteurs sont plus spécifiques que ceux du haut du fichier ; on
   re-déclare ici les seuls points sensibles, avec une spécificité supérieure.
   ========================================================================== */

/* ── 1. Empilement ───────────────────────────────────────────────────────── */
.pavelys-auth {
    position: relative;
    z-index: 100000;
}

.sticky-header-wrap .pavelys-auth .pavelys-auth-panel {
    z-index: 100001;
}

/* ── 2. Libellés ─────────────────────────────────────────────────────────── */
.pavelys-auth .pavelys-auth-panel label,
.pavelys-auth .pavelys-auth-panel .auth-form label {
    display: block;
    margin: 0 0 4px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #f2f2f2;
}

.pavelys-auth .pavelys-auth-panel .auth-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: #e0e0e0;
    text-transform: none;
}

/* ── 3. Champs ───────────────────────────────────────────────────────────── */
.pavelys-auth .pavelys-auth-panel .auth-form input[type="text"],
.pavelys-auth .pavelys-auth-panel .auth-form input[type="email"],
.pavelys-auth .pavelys-auth-panel .auth-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 14px;
    box-shadow: none;
}

.pavelys-auth .pavelys-auth-panel .auth-form input:focus {
    border-color: #f0a500;
    outline: 2px solid #f0a500;
    outline-offset: 1px;
    box-shadow: none;
}

.pavelys-auth .pavelys-auth-panel .auth-form input.has-error {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, .35);
}

/* ── 4. Boutons ──────────────────────────────────────────────────────────── */
/* !important nécessaire : my-account.css impose background/color en !important
   sur tout button[type="submit"] situé dans un <form> de la page Mon compte. */
.pavelys-auth .pavelys-auth-panel .auth-form button.auth-submit {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 4px;
    background: var(--c-green, #327c32) !important;
    color: #fff !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    transform: none;
}

.pavelys-auth .pavelys-auth-panel .auth-form button.auth-submit:hover {
    background: var(--c-green-dark, #1a6b2a) !important;
    box-shadow: none;
    transform: none;
}

.pavelys-auth .pavelys-auth-panel .auth-form button.auth-submit[disabled] {
    opacity: .65;
    transform: none;
}

.pavelys-auth .pavelys-auth-panel button.auth-switch--cta {
    background: #f0a500 !important;
    color: #1a1a1a !important;
    border-radius: 4px;
    text-transform: none;
    box-shadow: none;
}

.pavelys-auth .pavelys-auth-panel button.auth-switch--back {
    background: transparent !important;
    color: #ffd68a !important;
    box-shadow: none;
}

.pavelys-auth .pavelys-auth-panel a.auth-google {
    background: #fff !important;
    color: #3c4043 !important;
    border-radius: 4px;
    text-transform: none;
    transform: none;
}
