/* Cascina Bonfiglio — Dashboard punti e premi v3 (2026-04-30).
   HERO progress + barattolo grande + premi con bar + CTA prominenti.
*/
.cb-punti { padding: 0 0 60px; background: transparent; }
.cb-punti__inner {
    max-width: 100%;
    margin: 0;
    padding: 20px;
    border-radius: 18px;
    background: #fff;
}

/* ========== HERO ========== */
.cb-punti-hero {
    background: linear-gradient(135deg, #f8efdf 0%, #fbe9c7 100%);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 22px;
}
.cb-punti-hero__top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.cb-punti-hero__greet { display: flex; flex-direction: column; gap: 4px; }
.cb-punti-hero__points {
    margin: 0;
    font-family: var(--cb-font-heading);
    font-size: 48px; font-weight: 800;
    color: var(--cb-brown);
    line-height: 1;
    letter-spacing: -1px;
}
.cb-punti-hero__points small {
    font-size: 18px;
    font-weight: 600;
    color: var(--cb-green);
    margin-left: 8px;
    letter-spacing: 0;
}

/* KPI inline (no box) */
.cb-punti-hero__kpis {
    list-style: none; margin: 0; padding: 0;
    display: flex;
    gap: 0;
    align-items: stretch;
}
.cb-punti-hero__kpis li {
    padding: 4px 24px;
    text-align: center;
    border-right: 1px solid rgba(160, 130, 80, 0.15);
    display: flex; flex-direction: column; gap: 2px;
    min-width: 100px;
}
.cb-punti-hero__kpis li:last-child { border-right: 0; padding-right: 0; }
.cb-punti-hero__kpis li:first-child { padding-left: 0; }
.cb-punti-hero__kpis strong {
    font-family: var(--cb-font-heading);
    font-size: 24px; font-weight: 800;
    color: var(--cb-brown);
    line-height: 1;
}
.cb-punti-hero__kpis span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000;
    font-weight: 600;
}

/* Hero progress bar (full-width) */
.cb-punti-hero__progress {
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    padding: 16px 20px;
    backdrop-filter: blur(2px);
}
.cb-punti-hero__progress-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cb-punti-hero__progress-pre {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cb-green);
    font-weight: 700;
}
.cb-punti-hero__progress-title {
    flex: 1;
    font-family: var(--cb-font-heading);
    font-size: 16px; font-weight: 700;
    color: var(--cb-brown);
}
.cb-punti-hero__progress-missing {
    font-size: 13px;
    color: var(--cb-brown);
    font-weight: 700;
}
.cb-punti-hero__progress-bar {
    position: relative;
    height: 14px;
    background: #fff;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.cb-punti-hero__progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cb-green), #c5dba4);
    border-radius: 999px;
    transition: width .6s ease;
    min-width: 14px;
}
.cb-punti-hero__progress-bar em {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: var(--cb-brown);
    font-style: normal;
    letter-spacing: 0.04em;
}
.cb-punti-hero__progress--all {
    text-align: center;
    padding: 18px;
}
.cb-punti-hero__progress--all strong { display: block; font-size: 16px; color: var(--cb-green); margin-bottom: 4px; }

/* ========== GRID 2 colonne ========== */
.cb-punti__grid {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.cb-punti-card {
    background: #fff;
    border: 1px solid #efe9e2;
    border-radius: 18px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}
.cb-punti-card--left {
    background: #fbf7ee;
    border: 0;
    gap: 22px;
    align-items: stretch;
}
.cb-punti-card__title {
    margin: 0 0 18px;
    font-family: var(--cb-font-heading);
    font-size: 20px; font-weight: 800;
    color: var(--cb-brown);
}

/* ========== JAR (barattolo grande, centro) ========== */
.cb-punti-jar {
    text-align: center;
    padding: 8px 0 6px;
}
.cb-punti-jar__viz {
    position: relative;
    width: 130px;
    height: 220px;
    margin: 0 auto 10px;
}
.cb-punti-jar__img {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: auto;
    opacity: 0;
    animation: cb-jar-flash 380ms ease forwards;
}
.cb-punti-jar__img:nth-child(1) { animation-delay: 0ms; }
.cb-punti-jar__img:nth-child(2) { animation-delay: 220ms; }
.cb-punti-jar__img:nth-child(3) { animation-delay: 440ms; }
.cb-punti-jar__img:nth-child(4) { animation-delay: 660ms; }
.cb-punti-jar__img:nth-child(5) { animation-delay: 880ms; }
.cb-punti-jar__img.is-final { animation: cb-jar-fade 420ms ease forwards; }
@keyframes cb-jar-flash { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cb-jar-fade {
    0% { opacity: 0; transform: translateX(-50%) scale(0.94); }
    60% { opacity: 1; transform: translateX(-50%) scale(1.04); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .cb-punti-jar__img { animation: none; opacity: 0; }
    .cb-punti-jar__img.is-final { opacity: 1; }
}
.cb-punti-jar__num {
    position: absolute;
    top: 60%;
    left: 0; right: 0;
    transform: translateY(-50%);
    text-align: center;
    font-family: var(--cb-font-heading);
    font-size: 32px; font-weight: 800;
    color: #000;
    line-height: 1;
    letter-spacing: -0.5px;
    z-index: 2;
    transition: transform 180ms ease;
}
.cb-punti-jar__num.is-bump { animation: cb-jar-bump 600ms ease; }
@keyframes cb-jar-bump {
    0%   { transform: translateY(-50%) scale(1); }
    35%  { transform: translateY(-58%) scale(1.18); color: #2f6a3d; }
    100% { transform: translateY(-50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .cb-punti-jar__num.is-bump { animation: none; }
}
.cb-punti-jar__lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
    font-weight: 700;
    margin-top: 6px;
}

/* ========== EARN 2x2 ========== */
.cb-punti-earn {
    background: #fff;
    border-radius: 14px;
    padding: 17px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cb-punti-earn__title {
    margin: 0 0 16px;
    font-family: var(--cb-font-heading);
    font-size: 13px; font-weight: 700;
    color: var(--cb-brown);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cb-punti-earn__grid {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 1fr;
    gap: 10px;
    flex: 1;
}
.cb-punti-earn__grid li {
    display: grid;
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    gap: 2px 12px;
    align-items: center;
    padding: 14px 14px;
    background: #fbf7ee;
    border-radius: 10px;
}
.cb-punti-earn__icon {
    grid-row: 1 / 3;
    color: var(--cb-green);
    width: 32px; height: 32px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cb-punti-earn__lbl {
    font-size: 12px;
    color: #000;
    line-height: 1.25;
    font-weight: 600;
}
.cb-punti-earn__val {
    font-weight: 800;
    color: var(--cb-green);
    font-size: 14px;
    line-height: 1.2;
}

/* ========== REWARDS ========== */
.cb-punti-rewards {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 12px;
    flex: 1;
}
.cb-punti-reward {
    background: #fbf7ee;
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid transparent;
    transition: border-color .2s, background .2s, transform .15s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cb-punti-reward--unlock {
    background: #f3f9ec;
    border-color: #b6d490;
}
.cb-punti-reward--unlock:hover {
    border-color: var(--cb-green);
    transform: translateY(-1px);
}

.cb-punti-reward__head {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 14px;
    align-items: center;
}
.cb-punti-reward__icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--cb-green);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.cb-punti-reward--lock .cb-punti-reward__icon {
    color: #000;
    background: #f0ede4;
}
.cb-punti-reward__info { min-width: 0; }
.cb-punti-reward__info strong {
    display: block;
    font-family: var(--cb-font-heading);
    font-size: 14px; font-weight: 700;
    color: var(--cb-brown);
    line-height: 1.3;
    margin-bottom: 2px;
}
.cb-punti-reward__cost {
    display: block;
    font-size: 12px;
    color: #000;
    font-weight: 600;
}
.cb-punti-reward__value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cb-green);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    border-radius: 8px;
    padding: 6px 12px;
    flex-shrink: 0;
    letter-spacing: -0.2px;
}
.cb-punti-reward--lock .cb-punti-reward__value {
    background: #fff;
    color: var(--cb-brown);
    border: 1px solid #e5dfd2;
}

.cb-punti-reward__bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}
.cb-punti-reward__bar {
    height: 6px;
    background: #e8e1d0;
    border-radius: 999px;
    overflow: hidden;
}
.cb-punti-reward--unlock .cb-punti-reward__bar { background: #cfe1b3; }
.cb-punti-reward__bar > span {
    display: block; height: 100%;
    background: var(--cb-green);
    border-radius: 999px;
}

.cb-punti-reward__redeem {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 20px;
    height: 38px;
    border-radius: 999px;
    font-family: var(--cb-font-body);
    font-size: 13px; font-weight: 800;
    border: 0;
    cursor: pointer;
    background: var(--cb-green);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background .2s, transform .15s;
    box-shadow: 0 4px 12px rgba(125, 158, 79, 0.25);
}
.cb-punti-reward__redeem:hover { background: #6a8a4f; transform: translateY(-1px); }

.cb-punti-reward__missing {
    font-size: 12px;
    color: #000;
    font-weight: 600;
    white-space: nowrap;
}
.cb-punti-reward__missing strong { color: var(--cb-brown); font-weight: 800; }

/* CTA ospite + toast */
.cb-punti__login-cta {
    background: var(--cb-green);
    color: #fff;
    font-family: var(--cb-font-body);
    font-size: 13px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s ease;
}
.cb-punti__login-cta:hover { background: #6a8a4f; }

.cb-punti-toast {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}
.cb-punti-toast--ok  { background: #eaf3df; color: #4d6a32; border: 1px solid #cfe1b3; }
.cb-punti-toast--err { background: #fce6e6; color: #8c2727; border: 1px solid #f0c5c5; }

/* Responsive */
@media (max-width: 1100px) {
    .cb-punti__grid { grid-template-columns: 1fr; }
    .cb-punti-hero__top { flex-direction: column; align-items: flex-start; }
    .cb-punti-hero__kpis { width: 100%; justify-content: space-between; }
    .cb-punti-hero__kpis li { padding: 4px 12px; }
}

@media (max-width: 768px) {
    .cb-punti__inner { padding: 25px !important; border-radius: 14px; }
    .cb-punti-hero { padding: 20px 18px; border-radius: 14px; }
    .cb-punti-hero__points { font-size: 36px; }
    .cb-punti-hero__points small { font-size: 14px; }
    .cb-punti-hero__kpis { gap: 0; flex-wrap: wrap; }
    .cb-punti-hero__kpis li { padding: 6px 10px; min-width: 0; flex: 1 1 30%; }
    .cb-punti-hero__kpis strong { font-size: 18px; }
    .cb-punti-hero__kpis span { font-size: 9.5px; letter-spacing: 0.04em; }
    .cb-punti-hero__progress { padding: 12px 14px; }
    .cb-punti-hero__progress-meta { flex-direction: column; gap: 4px; align-items: flex-start; }
    .cb-punti-card { padding: 18px; border-radius: 14px; }
    .cb-punti-earn__grid { grid-template-columns: 1fr; }
    .cb-punti-reward__head { grid-template-columns: 36px 1fr; }
    .cb-punti-reward__value { grid-column: 2; justify-self: start; margin-top: 4px; }
    .cb-punti-reward__bottom { grid-template-columns: 1fr; }
    .cb-punti-reward__redeem, .cb-punti-reward__missing { width: 100%; text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
    .cb-punti-hero__kpis li { flex: 1 1 100%; border-right: 0; border-bottom: 1px solid rgba(160,130,80,.12); padding: 8px 0; text-align: left; flex-direction: row; justify-content: space-between; align-items: baseline; }
    .cb-punti-hero__kpis li:last-child { border-bottom: 0; }
}
