/* =====================================================
   COURRIERENLIGNE.FR — Espace client
   ===================================================== */

.account-shell {
    padding: 2rem 1rem 4rem;
    background: #F8FAFC;
    min-height: calc(100vh - 200px);
}
.account-container {
    max-width: 1100px;
    margin: 0 auto;
}
.account-container.account-narrow {
    max-width: 480px;
}

/* Breadcrumb : utilise maintenant le système global .cel-breadcrumb du header */

/* Page header */
.account-page-header {
    margin-bottom: 2rem;
}
.account-page-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}
.account-page-header .lead {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}

/* Card */
.account-card {
    background: #fff;
    border: 1px solid #E5E9F2;
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(15, 30, 60, 0.04);
}
.account-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 1.25rem;
    letter-spacing: -0.01em;
}
.account-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.account-card-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}
.account-card-header .lead {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
}
.account-card-header-inline h2 {
    margin-bottom: 1.25rem;
}

/* Form */
.account-form .field {
    margin-bottom: 1.1rem;
}
.account-form .field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.account-form .field input[type="text"],
.account-form .field input[type="email"],
.account-form .field input[type="password"],
.account-form .field input[type="tel"],
.account-form .field select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #E5E9F2;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.15s ease;
}
.account-form .field input:focus,
.account-form .field select:focus {
    outline: none;
    border-color: var(--bleu);
    box-shadow: 0 0 0 3px rgba(63, 114, 155, 0.12);
}
.account-form .field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.account-form .checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.92rem;
    cursor: pointer;
}

/* Card links */
.account-card-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.88rem;
}
.account-card-links a {
    color: var(--bleu);
    text-decoration: none;
}
.account-card-links a:hover {
    text-decoration: underline;
}
.account-card-links .sep {
    color: #CBD5E1;
    margin: 0 0.4rem;
}

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
}
.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}
.alert-danger {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}
.alert-danger a {
    color: #7F1D1D;
    text-decoration: underline;
}

/* Stats */
.account-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid #E5E9F2;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
}
.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bleu);
    letter-spacing: -0.02em;
    line-height: 1;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

/* Quick actions */
.account-quick-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Order list */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.order-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.2rem;
    background: #F8FAFC;
    border: 1px solid #E5E9F2;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}
.order-row:hover {
    background: #fff;
    border-color: var(--bleu);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 30, 60, 0.06);
}
.order-row-ref {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
}
.order-row-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.order-row-price {
    font-weight: 700;
    color: var(--bleu);
    font-size: 1.05rem;
}
.order-row-arrow {
    color: var(--muted);
}

/* Empty state */
.account-empty {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}
.account-empty p {
    margin-bottom: 1rem;
}

/* Detail page : 2-col layout */
.account-grid-2col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .account-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* Courrier detail card */
.courrier-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}
.courrier-detail-header h3 {
    margin: 0 0 0.2rem;
    font-size: 1.1rem;
    font-weight: 700;
}
.courrier-detail-meta {
    font-size: 0.85rem;
    color: var(--muted);
}
.courrier-detail-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #F1F5F9;
}
@media (max-width: 600px) {
    .courrier-detail-addresses {
        grid-template-columns: 1fr;
    }
}
.addr-mini {
    font-size: 0.88rem;
    line-height: 1.5;
}
.addr-mini .label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}
.courrier-detail-tracking-ref {
    margin-bottom: 1rem;
    font-size: 0.88rem;
}
.courrier-detail-tracking-ref code {
    background: #F1F5F9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--bleu);
}
.courrier-detail-tracking-ref .muted {
    color: var(--muted);
}
.courrier-detail-tracking-ref .tracking-ref-help {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.3rem;
    font-style: italic;
}

/* Tracking timeline */
.tracking-timeline {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #F1F5F9;
}
.tracking-timeline h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 1rem;
}
.tracking-timeline ol {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tracking-timeline ol li {
    position: relative;
    padding-left: 28px;
    padding-bottom: 1.2rem;
}
.tracking-timeline ol li:last-child {
    padding-bottom: 0;
}
.tracking-timeline ol li::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 18px;
    bottom: 0;
    width: 2px;
    background: #E5E9F2;
}
.tracking-timeline ol li:last-child::before {
    display: none;
}
.tracking-timeline .dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #CBD5E1;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #E5E9F2;
}
.tracking-timeline li.current .dot {
    background: var(--bleu);
    box-shadow: 0 0 0 1px var(--bleu), 0 0 0 4px rgba(63, 114, 155, 0.15);
}
.tracking-timeline .content .label {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.92rem;
}
.tracking-timeline .content .date {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}
.tracking-empty {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 8px;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}
.tracking-empty p {
    margin: 0;
}

/* Badges status (réutilise les styles existants si dispo, sinon défauts) */
.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}
.badge-success {
    background: #DCFCE7;
    color: #166534;
}
.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}
.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}
.badge-muted {
    background: #F1F5F9;
    color: #475569;
}

/* Address list */
.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.address-card {
    border: 1px solid #E5E9F2;
    border-radius: 10px;
    padding: 1rem;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.address-card-body {
    font-size: 0.88rem;
    line-height: 1.5;
}
.address-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--bleu);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}
.address-card-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* User dropdown menu (header) */
.cel-user-menu {
    position: relative;
}
.cel-user-menu .cel-btn-login {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
.cel-user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #fff;
    border: 1px solid #E5E9F2;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(15, 30, 60, 0.12);
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 1000;
}
.cel-user-dropdown.open {
    display: block;
}
.cel-user-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
}
.cel-user-dropdown a:hover {
    background: #F8FAFC;
}
.cel-user-dropdown a.danger {
    color: var(--danger);
}
.cel-user-dropdown hr {
    margin: 0.3rem 0;
    border: none;
    border-top: 1px solid #E5E9F2;
}

/* =====================================================
   CHECKBOX "Se souvenir de moi"
   ===================================================== */

.field-remember {
    margin: 0.4rem 0 1.4rem;
}

.remember-check {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.92rem;
    color: var(--ink, #0F1E3C);
}

.remember-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember-check-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #CBD5E0;
    border-radius: 5px;
    color: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.remember-check-box svg {
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.15s ease;
}

.remember-check input:checked + .remember-check-box {
    background: var(--bleu, #0060AE);
    border-color: var(--bleu, #0060AE);
    color: #fff;
}
.remember-check input:checked + .remember-check-box svg {
    opacity: 1;
    transform: scale(1);
}

.remember-check input:focus-visible + .remember-check-box {
    outline: 2px solid var(--bleu, #0060AE);
    outline-offset: 2px;
}

.remember-check:hover .remember-check-box {
    border-color: var(--bleu, #0060AE);
}

.remember-check-label {
    font-weight: 500;
}

.remember-help {
    margin: 0.35rem 0 0 1.6rem;
    font-size: 0.78rem;
    color: var(--muted, #6B7280);
    line-height: 1.4;
}

/* =====================================================
   SPRINT PROOFS : Documents officiels La Poste
   ===================================================== */

.proofs-section {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFEF5 100%);
    border: 1px solid #FFE599;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.proofs-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8B6914;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.proofs-title svg { color: #C29B1E; }

.proofs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.proof-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #FFE599;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink, #0F1E3C);
    transition: all 0.15s ease;
}

.proof-link:hover {
    border-color: #C29B1E;
    background: #FFFCEF;
    box-shadow: 0 2px 8px rgba(194, 155, 30, 0.15);
    transform: translateY(-1px);
}

.proof-link svg {
    color: var(--bleu, #0060AE);
    flex-shrink: 0;
}

.proof-link-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 1.3;
}

.proof-link-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink, #0F1E3C);
}

.proof-link-text small {
    font-size: 0.78rem;
    color: var(--muted, #6B7280);
}

/* ====================================================================
   ESPACE CLIENT — RESPONSIVE MOBILE (≤ 600px)
   ==================================================================== */
@media (max-width: 600px) {
    .account-shell { padding: 1rem 0; }
    .account-container { padding: 0 1rem; }
    .account-card { padding: 1rem; border-radius: 10px; }
    .account-page-header h1 { font-size: 1.5rem; line-height: 1.2; }
    .account-page-header .lead { font-size: 0.88rem; }
    .courrier-detail-header { flex-direction: column; align-items: stretch; }
    .courrier-detail-header h3 { font-size: 1rem; }
    .courrier-detail-header .badge { align-self: flex-start; }

    /* Liste de commandes : cards plus compactes */
    .orders-list-row,
    .order-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    /* Récap facture mobile : padding réduit */
    .recap-card { border-radius: 10px; }
    .recap-body { padding: 1rem !important; }
    .recap-row { font-size: 0.9rem; }

    /* Proofs mobile : boutons pleine largeur */
    .proof-link { padding: 0.85rem; gap: 0.65rem; }
    .proof-link svg { width: 22px; height: 22px; }
}

/* Largeur du panneau de détail commande mobile */
@media (max-width: 600px) {
    .account-grid-2col aside { order: -1; } /* récap en haut sur mobile */
}

/* Lien messagerie support depuis la page commande */
.support-link {
    background: #fff;
    border: 1.5px solid var(--bleu, #0060AE);
    color: var(--bleu, #0060AE);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
}
.support-link:hover {
    background: var(--bleu-pale, #EFF6FB);
    color: var(--bleu, #0060AE);
}
.support-badge {
    background: var(--danger, #DC2626);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
    line-height: 1;
    margin-left: 0.4rem;
}

/* Badge messages non-lus dans la liste des commandes */
.order-row-unread {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--danger, #DC2626);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
    line-height: 1;
}

/* ====================================================================
   PAGE /COMPTE/SESSIONS — gestion des appareils connectés
   ==================================================================== */
.sessions-empty {
    text-align: center;
    padding: 2rem 1rem;
}
.sessions-empty p:first-child {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.sessions-empty .muted {
    color: var(--muted);
    font-size: 0.88rem;
}

.sessions-actions-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.sessions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.session-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s ease;
}
.session-item:hover {
    border-color: #CBD5E1;
}
.session-item.session-current {
    border-color: var(--bleu);
    background: var(--bleu-pale, #EFF6FB);
}

.session-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #F1F5F9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.session-current .session-icon {
    background: var(--bleu);
    color: #fff;
}

.session-body {
    flex: 1;
    min-width: 0;
}
.session-title {
    font-weight: 700;
    color: var(--ink);
    font-size: 0.98rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.session-current-badge {
    background: var(--bleu);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.session-meta {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
    word-break: break-word;
}
.session-meta.muted {
    color: var(--muted);
    font-size: 0.78rem;
}
.session-meta code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    color: var(--ink);
}
.session-current .session-meta code {
    background: #fff;
}

.session-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.session-revoke-btn {
    color: var(--danger, #DC2626);
    border-color: var(--danger, #DC2626);
}
.session-revoke-btn:hover {
    background: var(--danger, #DC2626);
    color: #fff;
}
.session-current-pill {
    background: #fff;
    color: var(--bleu);
    border: 1px solid var(--bleu);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.sessions-info {
    margin-top: 1.5rem;
    padding: 0.85rem 1rem;
    background: #F8FAFC;
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .session-item {
        flex-wrap: wrap;
        padding: 0.85rem 1rem;
    }
    .session-actions {
        width: 100%;
        margin-top: 0.5rem;
        justify-content: flex-end;
    }
}

/* ====================================================================
   TRACKING LA POSTE — carte avec numéro réel + lien vers laposte.fr
   ==================================================================== */
.courrier-detail-tracking-real {
    margin: 1rem 0 1.25rem;
}
.laposte-tracking-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #FFEFD6 0%, #FFF8E8 100%);
    border: 1px solid #F5C97E;
    border-radius: 10px;
}
.laposte-tracking-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: #FFB320;  /* jaune La Poste */
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.laposte-tracking-body {
    flex: 1;
    min-width: 0;
}
.laposte-tracking-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8B6914;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.laposte-tracking-number {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
    word-break: break-all;
}
.laposte-tracking-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bleu);
    text-decoration: none;
}
.laposte-tracking-link:hover {
    text-decoration: underline;
}

@media (max-width: 500px) {
    .laposte-tracking-card { padding: 0.75rem 0.85rem; gap: 0.75rem; }
    .laposte-tracking-icon { width: 36px; height: 36px; }
    .laposte-tracking-number { font-size: 0.95rem; }
}
