/* =================================================================
   EmiliaParts V2 — components.css
   Composants réutilisables — charte A4
   ================================================================= */

/* --------------------------------------------------------------
   BOUTONS
   -------------------------------------------------------------- */
.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--ep-radius);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    background: var(--ep-white);
    color: var(--ep-text);
    cursor: pointer;
    transition: background var(--ep-tr-fast), border-color var(--ep-tr-fast), color var(--ep-tr-fast);
    text-decoration: none;
    font-family: inherit;
}

/* Primary CTA — rouge italien (acheter, rechercher, ajouter au panier) */
.ep-btn-primary {
    background: var(--ep-red);
    color: var(--ep-white);
    border-color: var(--ep-red);
}
.ep-btn-primary:hover { background: var(--ep-red-dark); border-color: var(--ep-red-dark); }

/* Secondary — noir (actions secondaires) */
.ep-btn-secondary {
    background: var(--ep-black);
    color: var(--ep-white);
    border-color: var(--ep-black);
}
.ep-btn-secondary:hover { background: #2a2a2a; border-color: #2a2a2a; }

/* Outline — fond blanc, bordure noire */
.ep-btn-outline {
    background: var(--ep-white);
    color: var(--ep-text);
    border-color: var(--ep-text);
}
.ep-btn-outline:hover { background: var(--ep-text); color: var(--ep-white); }

/* Info — bleu (compte client, livraison, info) */
.ep-btn-info {
    background: var(--ep-blue);
    color: var(--ep-white);
    border-color: var(--ep-blue);
}
.ep-btn-info:hover { background: var(--ep-blue-dark); border-color: var(--ep-blue-dark); }

/* Tailles */
.ep-btn-sm { padding: 6px 14px; font-size: 12px; }
.ep-btn-lg { padding: 14px 28px; font-size: 16px; }

/* --------------------------------------------------------------
   BADGES (états de stock, statuts)
   -------------------------------------------------------------- */
.ep-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--ep-radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    white-space: nowrap;
}

.ep-badge-stock-ok    { background: var(--ep-green-light);  color: var(--ep-green-dark); }
.ep-badge-stock-low   { background: var(--ep-orange-light); color: var(--ep-orange-dark); }
.ep-badge-stock-out   { background: var(--ep-red-light);    color: var(--ep-red-dark); }
.ep-badge-info        { background: var(--ep-blue-light);   color: var(--ep-blue-dark); }
.ep-badge-neutral     { background: var(--ep-bg-section);   color: var(--ep-text); }

/* --------------------------------------------------------------
   CARDS
   -------------------------------------------------------------- */
.ep-card {
    background: var(--ep-white);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    padding: 18px;
    transition: border-color var(--ep-tr-fast), transform var(--ep-tr-fast), box-shadow var(--ep-tr-fast);
}

.ep-card-hoverable:hover {
    border-color: var(--ep-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* Cards de marque avec accent coloré */
.ep-card-brand-ferrari  { border-top: 3px solid var(--ep-red); }
.ep-card-brand-maserati { border-top: 3px solid var(--ep-blue); }
.ep-card-brand-alfa     { border-top: 3px solid var(--ep-green); }

/* --------------------------------------------------------------
   FORMULAIRES
   -------------------------------------------------------------- */
.ep-input,
.ep-select,
.ep-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ep-text);
    background: var(--ep-white);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    outline: none;
    transition: border-color var(--ep-tr-fast), box-shadow var(--ep-tr-fast);
}

.ep-input:focus,
.ep-select:focus,
.ep-textarea:focus {
    border-color: var(--ep-text);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.ep-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ep-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* --------------------------------------------------------------
   UTILITAIRES — Container et grid
   -------------------------------------------------------------- */
.ep-container {
    max-width: var(--ep-max-width);
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 600px) {
    .ep-container { padding: 0 16px; }
}

/* --------------------------------------------------------------
   TABLES (utilisée par la page test)
   -------------------------------------------------------------- */
.ep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ep-table th,
.ep-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--ep-border-soft);
    vertical-align: middle;
}

.ep-table th {
    background: var(--ep-bg-section);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ep-text-muted);
    white-space: nowrap;
}

.ep-table tbody tr:hover {
    background: var(--ep-bg-soft);
}

.ep-table-ref {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--ep-text);
}

.ep-table-mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--ep-text-muted);
}

/* --------------------------------------------------------------
   AUTH (étape 4A — 5 mai 2026)
   Composants pour pages connexion / mon compte / déconnexion
   et topbar conditionnelle dans le menu.
   -------------------------------------------------------------- */

/* Conteneur principal des pages auth (login, register, forgot, etc.) */
.ep-auth-page {
    max-width: 460px;
    margin: 60px auto;
    padding: 0 16px;
}

.ep-auth-page-wide {
    max-width: 700px;
}

.ep-auth-title {
    text-align: center;
    margin-bottom: 8px;
}

.ep-auth-subtitle {
    text-align: center;
    color: var(--ep-text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

/* Carte qui contient le formulaire (login, register, etc.) */
.ep-auth-card {
    background: var(--ep-white);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius-md);
    padding: 28px;
}

/* Bandeau d'erreur (CSRF, credentials invalides, etc.) */
.ep-auth-error {
    background: var(--ep-red-light);
    border: 1px solid var(--ep-red);
    border-radius: var(--ep-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ep-red-dark);
}

/* Bandeau de succès (mdp changé, email validé, etc.) */
.ep-auth-success {
    background: var(--ep-green-light);
    border: 1px solid var(--ep-green);
    border-radius: var(--ep-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ep-green-dark);
}

/* Espacement entre champs dans un formulaire auth */
.ep-auth-card .ep-field {
    margin-bottom: 16px;
}

/* Lien "mot de passe oublié" sous le bouton submit */
.ep-auth-forgot {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
}

.ep-auth-forgot a {
    color: var(--ep-red);
    text-decoration: none;
}

.ep-auth-forgot a:hover {
    text-decoration: underline;
}

/* Note sous le formulaire ("Pas de compte ? S'inscrire") */
.ep-auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--ep-text-muted);
}

.ep-auth-footer a {
    color: var(--ep-red);
    font-weight: 600;
    text-decoration: none;
}

.ep-auth-footer a:hover {
    text-decoration: underline;
}

/* Page placeholder 4B (inscription, mdp oublié, etc.) */
.ep-auth-placeholder {
    text-align: center;
}

.ep-auth-placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.ep-auth-placeholder-msg {
    font-size: 16px;
    color: var(--ep-text-muted);
    margin-bottom: 8px;
}

.ep-auth-placeholder-sub {
    font-size: 14px;
    color: var(--ep-text-subtle);
    margin-bottom: 24px;
}

/* Page Mon compte : table d'infos */
.ep-account-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ep-account-info-table tr {
    border-top: 1px solid var(--ep-border-soft);
}

.ep-account-info-table tr:first-child {
    border-top: none;
}

.ep-account-info-table td {
    padding: 10px 0;
}

.ep-account-info-table td:first-child {
    color: var(--ep-text-muted);
}

.ep-account-info-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.ep-account-greeting {
    font-size: 18px;
    margin-bottom: 8px;
}

.ep-account-email {
    color: var(--ep-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.ep-account-note {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ep-border-soft);
    font-size: 13px;
    color: var(--ep-text-muted);
}

/* Bouton "Déconnexion" — outline rouge discret */
.ep-btn-logout {
    display: inline-block;
    padding: 10px 22px;
    background: transparent;
    color: var(--ep-red);
    border: 1px solid var(--ep-red-light);
    border-radius: var(--ep-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background var(--ep-tr-fast), border-color var(--ep-tr-fast);
}

.ep-btn-logout:hover {
    background: var(--ep-red-light);
    border-color: var(--ep-red);
}

/* --------------------------------------------------------------
   TOPBAR AUTH dans le menu principal (4A.2.c)
   Bloc "Mon compte ▾" / "Connexion" + "Panier" à droite de la nav
   -------------------------------------------------------------- */

/* Header du sous-menu Mon compte (prénom de l'utilisateur) */
.ep-nav-account-header {
    display: block;
    padding: 8px 14px;
    font-size: 11px;
    color: var(--ep-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--ep-border-soft);
    font-weight: 600;
}

/* Séparateur dans le sous-menu (avant Déconnexion) */
.ep-nav-submenu-sep {
    height: 1px;
    background: var(--ep-border-soft);
    margin: 4px 0;
    list-style: none;
}

/* Item de sous-menu désactivé (bientôt) */
.ep-nav-disabled {
    color: var(--ep-text-subtle) !important;
    cursor: not-allowed;
    pointer-events: none;
}

.ep-nav-disabled .ep-nav-soon {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--ep-bg-section);
    color: var(--ep-text-muted);
    border-radius: 99px;
    vertical-align: middle;
}

/* Bouton "Déconnexion" dans le sous-menu (form POST inline) */
.ep-nav-logout-form {
    margin: 0;
    padding: 0;
}

.ep-nav-logout-btn {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--ep-red);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: background var(--ep-tr-fast);
}

.ep-nav-logout-btn:hover {
    background: var(--ep-red-light);
}

/* Mobile : version compacte du form logout */
.ep-mobile-logout-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--ep-red);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    padding: inherit;
}

/* --------------------------------------------------------------
   PANIER dans la nav (placeholder visuel, vraie logique étape 8+)
   -------------------------------------------------------------- */

.ep-nav-cart .ep-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ep-cart-icon {
    display: inline-flex;
    align-items: center;
    color: currentColor;
}

.ep-cart-icon svg {
    display: block;
}

/* Compteur du panier — un peu plus discret que le mot "Panier" */
.ep-cart-count {
    font-size: 12px;
    color: var(--ep-text-muted);
    font-weight: 500;
}

/* Quand le panier a des items, on basculera .ep-nav-cart-has-items */
.ep-nav-cart-has-items .ep-cart-count {
    color: var(--ep-red);
    font-weight: 700;
}

