:root {
    --blu: #1c3d5a;
    --blu-scuro: #12283d;
    --sfondo: #f2f4f7;
    --testo: #1a1a1a;
    --errore: #b00020;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--sfondo);
    color: var(--testo);
}

.login-wrap {
    max-width: 360px;
    margin: 15vh auto 0;
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-wrap h1 {
    font-size: 20px;
    margin: 0 0 16px;
    color: var(--blu);
    text-align: center;
}

.login-wrap label {
    display: block;
    margin: 12px 0 4px;
    font-size: 13px;
    color: #555;
}

.login-wrap input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.login-wrap button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 16px;
    background: var(--blu);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-wrap button:active { background: var(--blu-scuro); }

.errore {
    background: #fdeaea;
    color: var(--errore);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 8px;
}

.installa-app {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.installa-app summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--blu);
    font-weight: 600;
    outline: none;
}

.installa-app summary::-webkit-details-marker,
.installa-app summary::marker {
    display: none;
    content: "";
}

.installa-chevron {
    font-size: 20px;
    line-height: 1;
    color: #b0b8c0;
    transition: transform 0.15s ease;
}

.installa-app[open] .installa-chevron {
    transform: rotate(90deg);
}

.installa-corpo {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.installa-piattaforma {
    background: var(--sfondo);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 14px;
    text-align: left;
}

.installa-piattaforma-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.installa-piattaforma-nome {
    font-size: 13px;
    font-weight: 600;
    color: var(--testo);
}

.badge-tipo-ios {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-tipo-android {
    background: #dcfce7;
    color: #15803d;
}

.installa-passi {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.installa-passi li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--testo);
    line-height: 1.5;
}

.installa-passo-num {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--blu);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.installa-icona-inline {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid #999;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
}

.installa-nota {
    margin: 4px 2px 0;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--blu);
    color: #fff;
    position: sticky;
    top: 0;
}

.logout-link {
    color: #fff;
    text-decoration: underline;
    font-size: 14px;
}

.barcode-list {
    max-width: 480px;
    margin: 16px auto;
    padding: 0 12px;
}

.barcode-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    padding: 16px;
    margin-bottom: 10px;
    text-align: left;
    cursor: pointer;
}

.barcode-card:active {
    background: #f7f9fb;
}

.barcode-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.barcode-targa {
    font-size: 16px;
    font-weight: 700;
}

.badge-tipo {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 2px;
}

.badge-tipo-tessera {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-tipo-targa {
    background: #dcfce7;
    color: #15803d;
}

.barcode-desc {
    font-size: 13px;
    font-weight: 400;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.barcode-chevron {
    font-size: 24px;
    color: #b0b8c0;
    line-height: 1;
    flex-shrink: 0;
}

.vuoto {
    text-align: center;
    color: #666;
    margin-top: 40px;
    padding: 0 20px;
}

.barcode-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.barcode-overlay.aperto {
    display: flex;
}

.barcode-overlay-content {
    width: 360px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

.tessera-barcode svg {
    width: 100%;
    height: auto;
    display: block;
}

.tessera-dati {
    margin: 20px 0 0;
}

.tessera-dati > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    text-align: left;
}

.tessera-dati > div:last-child {
    border-bottom: none;
}

.tessera-dati dt {
    color: #666;
    font-size: 12px;
    text-align: left;
}

.tessera-dati dd {
    margin: 0;
    font-weight: 600;
    text-align: left;
}

.tessera-indietro {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    background: var(--blu);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.tessera-indietro:active {
    background: var(--blu-scuro);
}
