/* ============================================
   YVES ROCHER — MY ACCOUNT (Login + Dashboard)
   ============================================ */

/* This module now shares the main site's brand green and typography.
   Values that exactly match a shared token reuse it directly; only the
   handful of colors genuinely unique to this module keep a local name. */
:root {
    --yr-color-green: var(--color-brand-green);
    --yr-color-green-btn-dark: var(--color-brand-green);
    --yr-color-green-btn-dark-hover: var(--color-brand-green-dark);
    --yr-color-green-btn-light: var(--color-brand-green-light);
    --yr-color-green-btn-light-hover: var(--color-brand-green-light-hover);

    --yr-color-text: #1a1a1a;
    --yr-color-text-secondary: var(--color-text-secondary);
    --yr-color-text-tertiary: var(--color-gray-500);
    --yr-color-text-dark: var(--color-text-dark);

    --yr-color-border: #e5e5e5;
    --yr-color-bg-soft: var(--color-border-light);
    --yr-color-bg-softer: var(--color-bg-soft);
    --yr-color-bg-faint: #fafafa;
    --yr-color-divider: #d1d1d1;
    --yr-color-gray-400: var(--color-gray-400);

    --yr-color-error-bg: #fef2f2;
    --yr-color-error-bg-strong: #fee2e2;
    --yr-color-error-text: #991b1b;
    --yr-color-success-bg: #f0fdf4;
    --yr-color-success-bg-strong: #e8f5e9;
    --yr-color-success-text: #14532d;
    --yr-color-info-bg: #eff6ff;
    --yr-color-info-text: #1e3a8a;
}

/* ---------- BASE / LOGIN PAGE ---------- */
.yr-my-account-page {
    background: var(--color-white, #ffffff);
    min-height: 100vh;
    padding: 0 16px 40px;
    font-family: 'Outfit', sans-serif;
    color: var(--yr-color-text);
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- NOTICES WOOCOMMERCE ---------- */
body.woocommerce-account .yr-my-account-page .woocommerce-error,
body.woocommerce-account .yr-my-account-page .woocommerce-message,
body.woocommerce-account .yr-my-account-page .woocommerce-info {
    border-radius: 10px !important;
    font-size: 14px;
    margin: 0 auto 20px auto !important;
    max-width: 860px;
    padding: 14px 18px !important;
    border: none !important;
}

body.woocommerce-account .yr-my-account-page .woocommerce-error {
    background: var(--yr-color-error-bg) !important;
    color: var(--yr-color-error-text) !important;
}

body.woocommerce-account .yr-my-account-page .woocommerce-message {
    background: var(--yr-color-success-bg) !important;
    color: var(--yr-color-success-text) !important;
}

body.woocommerce-account .yr-my-account-page .woocommerce-info {
    background: var(--yr-color-info-bg) !important;
    color: var(--yr-color-info-text) !important;
}

/* ============================================
   LOGIN / REGISTER (non connecté)
   ============================================ */
.yr-auth-section {
    max-width: 480px;
    margin: 0 auto;
    padding-top: 24px;
}

.yr-form-group { margin-bottom: 16px; }

.yr-label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--yr-color-green);
    margin-bottom: 6px;
}

.yr-required { color: var(--yr-color-green); }

.yr-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--yr-color-divider);
    border-radius: 10px;
    font-size: 16px;
    color: var(--yr-color-text);
    background: var(--color-white, #ffffff);
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yr-input:focus {
    border-color: var(--yr-color-green);
    box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.08);
}

.yr-input::placeholder { color: var(--yr-color-gray-400); font-size: 15px; }

.yr-input-wrapper { position: relative; }
.yr-input-wrapper .yr-input { padding-right: 50px; }

.yr-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--yr-color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.yr-password-toggle:hover { color: var(--yr-color-green); }

.yr-form-row { margin-bottom: 16px; }
.yr-form-row--right { text-align: right; }
.yr-form-row--center { text-align: center; margin-top: 16px; }

.yr-link {
    color: var(--yr-color-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 14px;
    font-weight: 400;
}

.yr-link:hover { color: var(--yr-color-green); }

.yr-btn {
    display: block;
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.yr-btn:active { transform: scale(0.98); }

.yr-btn--dark { background: var(--yr-color-green-btn-dark); color: var(--color-white, #ffffff); }
.yr-btn--dark:hover { background: var(--yr-color-green-btn-dark-hover); }

.yr-btn--light { background: var(--yr-color-green-btn-light); color: var(--color-white, #ffffff); }
.yr-btn--light:hover { background: var(--yr-color-green-btn-light-hover); }

.yr-note { font-size: 13px; color: var(--yr-color-text-secondary); margin-top: 12px; margin-bottom: 0; }

.yr-separator {
    display: flex;
    align-items: center;
    margin: 32px auto;
    gap: 16px;
    max-width: 480px;
}

.yr-separator__line { flex: 1; height: 1px; background: var(--yr-color-text); }
.yr-separator__text { font-size: 22px; font-weight: 700; color: var(--yr-color-text); white-space: nowrap; }

.yr-register-section { margin-top: 8px; max-width: 480px; margin-left: auto; margin-right: auto; }
.yr-register-block { margin-bottom: 8px; }
.yr-register-title { font-size: 17px; font-weight: 500; color: var(--yr-color-text-dark); margin-bottom: 12px; margin-top: 0; }

.yr-legal-texts { margin-top: 32px; }
.yr-legal-p { font-size: 12px; line-height: 1.6; color: var(--yr-color-text-secondary); margin-bottom: 20px; }
.yr-legal-p a { color: var(--yr-color-text); text-decoration: underline; }

.yr-terms-block { display: flex; gap: 12px; margin-bottom: 20px; align-items: flex-start; }
.yr-terms-icon { flex-shrink: 0; margin-top: 2px; }
.yr-terms-text { font-size: 12px; line-height: 1.6; color: var(--yr-color-text-secondary); margin: 0; }
.yr-terms-text a { color: var(--yr-color-text); text-decoration: underline; }

.yr-footnote { font-size: 12px; line-height: 1.5; color: var(--yr-color-text-secondary); margin: 0; }
.yr-footnote strong { color: var(--yr-color-text-dark); }

/* Lost password */
.yr-lost-title { font-size: 22px; font-weight: 700; color: var(--yr-color-text); text-align: center; margin-bottom: 24px; margin-top: 0; }
.yr-lost-text { font-size: 15px; color: var(--yr-color-text-secondary); text-align: center; line-height: 1.6; margin-bottom: 8px; }
.yr-lost-confirm { text-align: center; padding-top: 40px; }
.yr-reset-section .yr-lost-title { margin-bottom: 24px; }

/* ============================================
   DASHBOARD CONNECTÉ — HAUTE SPECIFICITÉ
   ============================================ */

body.woocommerce-account .yr-dashboard {
    max-width: 860px;
    margin: 0 auto;
    padding-top: 24px;
}

/* ---------- NAVIGATION ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation {
    margin-bottom: 32px !important;
    float: none !important;
    width: 100% !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 0 16px 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    border-bottom: 1px solid var(--yr-color-border) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation-link {
    margin: 0 !important;
    border: none !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation-link a {
    display: block !important;
    padding: 10px 18px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--yr-color-text-tertiary) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    border: none !important;
    background: transparent !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation-link a:hover {
    background: var(--yr-color-success-bg) !important;
    color: var(--yr-color-green) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation-link.is-active a {
    background: var(--yr-color-green-btn-dark) !important;
    color: var(--color-white, #ffffff) !important;
    font-weight: 600 !important;
}

/* ---------- CONTENU ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
    background: var(--color-white, #ffffff) !important;
    border-radius: 12px !important;
    border: 1px solid var(--yr-color-border) !important;
    padding: 24px !important;
    margin: 0 !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content > p:first-child { margin-top: 0; }

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content h2,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content h3 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--yr-color-text) !important;
    margin: 0 0 20px 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--yr-color-bg-soft) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content a:not(.button):not(.yr-btn) {
    color: var(--yr-color-green) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
}

/* ---------- TABLEAUX (Commandes) ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
    margin-bottom: 20px !important;
    border: none !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table thead th {
    text-align: left !important;
    padding: 12px 10px !important;
    font-weight: 600 !important;
    color: var(--yr-color-text-secondary) !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid var(--yr-color-border) !important;
    background: transparent !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody td {
    padding: 14px 10px !important;
    border-bottom: 1px solid var(--yr-color-bg-soft) !important;
    vertical-align: middle !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody tr:hover td {
    background: var(--yr-color-bg-faint) !important;
}

/* ---------- BOUTONS DANS LE CONTENU ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .button,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 44px !important;
    padding: 0 20px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.1s ease, opacity 0.2s ease !important;
    background: var(--yr-color-green-btn-dark) !important;
    color: var(--color-white, #ffffff) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .button:hover,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button:hover {
    background: var(--yr-color-green-btn-dark-hover) !important;
    color: var(--color-white, #ffffff) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .button:active {
    transform: scale(0.98) !important;
}

/* Bouton secondaire */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--pay,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--view {
    background: var(--yr-color-green-btn-light) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--pay:hover,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--view:hover {
    background: var(--yr-color-green-btn-light-hover) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--cancel {
    background: var(--yr-color-error-bg) !important;
    color: var(--yr-color-error-text) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-button--cancel:hover {
    background: var(--yr-color-error-bg-strong) !important;
}

/* ---------- FORMULAIRES (Adresses, Compte) ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content form { margin-top: 8px; }

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .form-row {
    margin-bottom: 16px !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .form-row label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--yr-color-text-dark) !important;
    margin-bottom: 6px !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .form-row .required {
    color: var(--yr-color-green) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .input-text,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content select,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content textarea {
    width: 100% !important;
    height: 52px !important;
    padding: 0 16px !important;
    border: 1.5px solid var(--yr-color-divider) !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    color: var(--yr-color-text) !important;
    background: var(--color-white, #ffffff) !important;
    outline: none !important;
    -webkit-appearance: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .input-text:focus,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content select:focus,
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content textarea:focus {
    border-color: var(--yr-color-green) !important;
    box-shadow: 0 0 0 3px rgba(0, 102, 51, 0.08) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content textarea {
    height: auto !important;
    padding-top: 12px !important;
    min-height: 120px !important;
    resize: vertical !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content fieldset {
    border: 1px solid var(--yr-color-border) !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin: 24px 0 !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content fieldset legend {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--yr-color-text-dark) !important;
    padding: 0 8px !important;
}

/* ---------- ADRESSES ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content address {
    font-style: normal !important;
    line-height: 1.7 !important;
    color: var(--yr-color-text-tertiary) !important;
    padding: 16px !important;
    border: 1px solid var(--yr-color-border) !important;
    border-radius: 10px !important;
    background: var(--yr-color-bg-faint) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 16px !important;
}

/* ---------- PAGINATION ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-pagination {
    margin-top: 20px !important;
    text-align: center !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-pagination .page-numbers {
    display: inline-flex !important;
    gap: 6px !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-pagination .page-numbers li a,
body.woocommerce-account .yr-dashboard .woocommerce-pagination .page-numbers li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    color: var(--yr-color-text-tertiary) !important;
    background: var(--yr-color-bg-softer) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-pagination .page-numbers li span.current {
    background: var(--yr-color-green-btn-dark) !important;
    color: var(--color-white, #ffffff) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-pagination .page-numbers li a:hover {
    background: var(--yr-color-success-bg-strong) !important;
    color: var(--yr-color-green) !important;
}

/* ---------- ORDERS DETAILS ---------- */
body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content ul.order_details {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content ul.order_details li {
    padding: 10px 0 !important;
    border-bottom: 1px solid var(--yr-color-bg-soft) !important;
    font-size: 14px !important;
    color: var(--yr-color-text-tertiary) !important;
}

body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content ul.order_details li strong {
    color: var(--yr-color-text) !important;
    font-weight: 600 !important;
}

/* ---------- RESPONSIVE ---------- */
@media (min-width: 640px) {
    .yr-my-account-page { padding: 40px 24px; }
    .yr-separator__text { font-size: 26px; }
}

@media (min-width: 768px) {
    body.woocommerce-account .yr-dashboard { padding-top: 32px; }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation ul { gap: 12px !important; }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content { padding: 32px !important; }
}

@media (max-width: 480px) {
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation ul {
        gap: 6px !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-navigation-link a {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content {
        padding: 18px !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table thead {
        display: none !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px !important;
        border-bottom: 1px solid var(--yr-color-bg-soft) !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody td::before {
        content: attr(data-title) !important;
        font-weight: 600 !important;
        color: var(--yr-color-text-secondary) !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
    }
    body.woocommerce-account .yr-dashboard .woocommerce-MyAccount-content table.shop_table tbody tr {
        display: block !important;
        margin-bottom: 16px !important;
        border: 1px solid var(--yr-color-border) !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }
}