/* E-SENAT APK Manager — Widget CSS v3.1 */

.esenat-wrap {
    font-family: Arial, Helvetica, sans-serif;
    display: block;
    width: 100%;
    max-width: 460px;
}

/* ── Carte ──────────────────────────────────────────────────────── */
.esenat-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border: 3px solid #1e7a1e;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.09);
    box-sizing: border-box;
}

/* ── En-tête gradient vert ──────────────────────────────────────── */
.esenat-hdr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 20px;
    margin: 6px 6px 0;
    border-radius: 12px 12px 0 0;
    cursor: pointer;
    transition: filter .18s;
    user-select: none;
    -webkit-user-select: none;
}
.esenat-hdr:hover { filter: brightness(1.1); }
.esenat-hdr-txt {
    color: #fff;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 700;
    letter-spacing: .2px;
    text-align: center;
}

/* ── Corps ──────────────────────────────────────────────────────── */
.esenat-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 14px;
    gap: 12px;
}

/* ── Badges ─────────────────────────────────────────────────────── */
.esenat-badges {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.esenat-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: #f3f3f3;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 500;
    color: #333;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* ── QR code responsive ─────────────────────────────────────────── */
.esenat-qr-wrap {
    flex-shrink: 0;
    /* Taille responsive : 20% de la largeur du viewport, min 72px, max 110px */
    width:  clamp(72px, 20vw, 110px);
    height: clamp(72px, 20vw, 110px);
    position: relative;
}
.esenat-qr {
    width:  100%;
    height: 100%;
    position: relative;
}
/* Le canvas généré par QRCode.js est redimensionné en CSS */
.esenat-qr canvas,
.esenat-qr img {
    display: block;
    width:  100% !important;
    height: 100% !important;
    image-rendering: pixelated;   /* netteté sur petits écrans */
    image-rendering: crisp-edges;
}

/* ── Statut ─────────────────────────────────────────────────────── */
.esenat-status {
    font-size: 12px;
    padding: 0 16px;
    min-height: 0;
    transition: all .2s;
}
.esenat-status:not(:empty) { padding-bottom: 10px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 360px) {
    .esenat-hdr { padding: 10px 12px; margin: 4px 4px 0; }
    .esenat-body { padding: 10px 10px 12px; gap: 8px; }
    .esenat-qr-wrap {
        width:  clamp(64px, 22vw, 80px);
        height: clamp(64px, 22vw, 80px);
    }
}
