﻿/* 25/11/2026 "Regala un abbonamento" - biglietto d'auguri, pannello nel checkout, pagina /Regalo */

.rg-card {
    position: relative; overflow: hidden; box-sizing: border-box;
    background: var(--rg-sfondo); color: var(--rg-testo);
    border-radius: 18px; padding: 34px 44px 52px; text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    font-family: Georgia, 'Times New Roman', serif;
    max-width: 460px; margin: 0 auto;
}
.rg-card::after { /* cornice interna */
    content: ""; position: absolute; inset: 10px; border: 1.5px solid var(--rg-primario);
    border-radius: 12px; opacity: .45; pointer-events: none;
}
.rg-deco { position: absolute; width: 34px; height: 34px; opacity: .9; }
.rg-d1 { top: 18px; left: 18px; transform: rotate(-12deg); }
.rg-d2 { top: 24px; right: 22px; width: 24px; height: 24px; transform: rotate(14deg); }
.rg-d3 { bottom: 22px; left: 26px; width: 22px; height: 22px; transform: rotate(20deg); }
.rg-d4 { bottom: 18px; right: 18px; transform: rotate(-8deg); }
.rg-emoji { font-size: 52px; line-height: 1; }
/* 27/11/2026 fascia foto in cima (JPG dal server, uguale al PDF): sostituisce emoji, titolo, cornice e decori in alto */
.rg-banner { display: block; width: calc(100% + 88px); max-width: none; height: auto; margin: -34px -44px 18px; aspect-ratio: 595 / 188; object-fit: cover; }
.rg-con-banner::after, .rg-con-banner .rg-emoji, .rg-con-banner .rg-titolo,
.rg-con-banner .rg-d1, .rg-con-banner .rg-d2 { display: none; }
.rg-titolo { color: var(--rg-primario); font-size: 30px; font-weight: bold; margin-top: 10px; }
.rg-per { font-family: Arial, Helvetica, sans-serif; font-size: 18px; margin-top: 16px; }
.rg-msg { font-style: italic; font-size: 18px; line-height: 1.45; margin: 14px 8px 0; word-wrap: break-word; }
.rg-da { font-family: Arial, Helvetica, sans-serif; font-size: 15px; margin-top: 14px; opacity: .95; }
.rg-info {
    font-family: Arial, Helvetica, sans-serif; margin-top: 20px; padding-top: 14px;
    border-top: 1px dashed var(--rg-primario); font-size: 14px;
}
.rg-luogo { font-weight: bold; letter-spacing: .02em; text-transform: uppercase; }
.rg-abbo, .rg-abbo-desc { margin: 8px 0 0; padding: 0; list-style: none; }
.rg-abbo li { margin-top: 6px; }
.rg-abbo li span { display: block; font-size: 13px; opacity: .9; }

/* --- pannello nel checkout --- */
.regalo-box { margin: 22px 0; }
.regalo-testata {
    display: flex; align-items: center; gap: 14px; cursor: pointer; margin: 0;
    padding: 16px 20px; border-radius: 16px; color: #fff;
    background: linear-gradient(135deg, #b91c1c 0%, #e11d48 55%, #f59e0b 100%);
    box-shadow: 0 6px 18px rgba(185, 28, 28, .28); transition: transform .15s, box-shadow .15s;
}
.regalo-testata:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(185, 28, 28, .35); }
.regalo-testata input[type=checkbox] { width: 26px; height: 26px; flex: 0 0 26px; accent-color: #facc15; cursor: pointer; margin: 0; }
.regalo-testata-icona { font-size: 40px; line-height: 1; flex: 0 0 auto; }
.regalo-testata-testi { display: flex; flex-direction: column; }
.regalo-testata-titolo { font-size: 1.45rem; font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.regalo-testata-sotto { font-size: .95rem; opacity: .95; margin-top: 3px; line-height: 1.35; }
.regalo-box.attivo .regalo-testata { border-radius: 16px 16px 0 0; }
.regalo-campi { margin: 0 !important; padding: 16px; border: 2px solid #e11d48; border-top: 0; border-radius: 0 0 16px 16px; background: #fff7ed; }
.regalo-destinatario { padding: 8px 12px; background: #fff; border: 1px solid #fed7aa; border-radius: 10px; }
@media (max-width: 575px) {
    .regalo-testata { padding: 14px; gap: 10px; }
    .regalo-testata-icona { font-size: 32px; }
    .regalo-testata-titolo { font-size: 1.25rem; }
}
.regalo-layouts { display: flex; gap: 8px; flex-wrap: wrap; }
.regalo-layout-btn {
    border: 2px solid transparent; border-radius: 10px; padding: 6px 12px; cursor: pointer;
    font-size: .9rem; font-weight: 600; min-width: 90px;
}
.regalo-layout-btn.attivo { border-color: #111827; box-shadow: 0 0 0 2px #fff inset; }
.regalo-anteprima { margin-top: 10px; }
.regalo-anteprima .rg-card { transform-origin: top center; }
@media (min-width: 992px) { .regalo-anteprima { position: sticky; top: 90px; } }

/* --- pagina /Regalo/{token} --- */
.rg-pagina { min-height: 70vh; padding: 32px 16px 48px; }
.rg-pacco { text-align: center; cursor: pointer; user-select: none; }
.rg-pacco-scatola { font-size: 120px; line-height: 1; display: inline-block; animation: rg-dondola 1.6s ease-in-out infinite; }
.rg-pacco-testo { font-family: Arial, Helvetica, sans-serif; font-size: 1.2rem; margin-top: 12px; }
.rg-pacco.aperto .rg-pacco-scatola { animation: rg-apri .6s ease-in forwards; }
.rg-contenuto { display: none; }
.rg-contenuto.visibile { display: block; animation: rg-entra .7s ease-out; }
.rg-azioni { text-align: center; margin-top: 24px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes rg-dondola { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) scale(1.05); } }
@keyframes rg-apri { to { transform: scale(1.6) rotate(12deg); opacity: 0; } }
@keyframes rg-entra { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@media print {
    body * { visibility: hidden; }
    .rg-card, .rg-card * { visibility: visible; }
    /* 25/11: i browser di default NON stampano gli sfondi (usciva grigio su bianco): forziamo colori e sfondo */
    .rg-card, .rg-card * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    .rg-card { position: absolute; left: 50%; top: 12mm; transform: translateX(-50%); box-shadow: none; width: 150mm; max-width: 150mm; }
    @page { size: A4 portrait; margin: 10mm; }
}

/* giro 3: anteprima, avviso più abbonamenti, "Compila tutti" */
.regalo-anteprima-titolo {
    display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    background: #111827; color: #facc15; font-weight: 800; letter-spacing: .08em;
    padding: 6px 14px; border-radius: 999px; font-size: .95rem; margin-bottom: 10px;
}
.regalo-anteprima-titolo span { color: #e5e7eb; font-weight: 400; letter-spacing: 0; font-size: .85rem; }
.regalo-anteprima { border: 2px dashed #fdba74; border-radius: 16px; padding: 14px; background: #fff; }
.regalo-avviso {
    background: #fef3c7; border: 1px solid #f59e0b; border-left: 5px solid #f59e0b; color: #78350f;
    border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: .95rem;
}
.btn-compila-tutti {
    background: #eff6ff; color: #1d4ed8; border: 2px solid #93c5fd; border-radius: 999px;
    font-weight: 600; padding: 6px 16px;
}
.btn-compila-tutti:hover { background: #dbeafe; color: #1e40af; border-color: #60a5fa; }

/* giro 4: tendine con la stessa "dignità" delle caselle di testo del portale */
.regalo-box .form-label { display: block; font-weight: 600; margin-bottom: 6px; }
.regalo-box select {
    display: block; width: 100%; box-sizing: border-box;
    min-height: 46px; padding: 10px 44px 10px 16px;
    font-size: 1rem; font-family: inherit; color: #111827; line-height: 1.4;
    background-color: #f1f2f4; border: 1px solid #e5e7eb; border-radius: 12px;
    -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f97316' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.regalo-box select:hover { border-color: #fdba74; }
.regalo-box select:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.18); background-color: #fff; }
.regalo-destinatario select { margin-top: 2px; }
.regalo-box .row > [class*="col-"] { min-width: 0; }

/* giro 4: tendine con la stessa "dignità" delle caselle di testo del portale */
.regalo-box .form-label { display: block; font-weight: 600; margin-bottom: 6px; }
.regalo-box select {
    display: block; width: 100%; box-sizing: border-box;
    min-height: 46px; padding: 10px 44px 10px 16px;
    font-size: 1rem; font-family: inherit; color: #111827; line-height: 1.4;
    background-color: #f1f2f4; border: 1px solid #e5e7eb; border-radius: 12px;
    -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23f97316' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px;
    transition: border-color .15s, box-shadow .15s;
}
.regalo-box select:hover { border-color: #fdba74; }
.regalo-box select:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.18); background-color: #fff; }
.regalo-box .row > [class*="col-"] { min-width: 0; }

/* giro 5: il pacchetto 🎁 (rosso/giallo) spariva nello sfondo rosso/oro: lo mettiamo in un bollo bianco */
.regalo-testata-icona {
    display: inline-flex; align-items: center; justify-content: center;
    width: 60px; height: 60px; flex: 0 0 60px; border-radius: 50%;
    background: #fff; font-size: 36px; box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
@media (max-width: 575px) { .regalo-testata-icona { width: 48px; height: 48px; flex-basis: 48px; font-size: 28px; } }

/* giro 6: campo che blocca il regalo */
.regalo-errore { border: 2px solid #dc2626 !important; box-shadow: 0 0 0 4px rgba(220,38,38,.18) !important; background-color: #fef2f2 !important; }
input[type=checkbox].regalo-errore { outline: 3px solid #dc2626; outline-offset: 2px; }

/* giro 12: busta elegante al posto dell'emoji del pacco (pagina /Regalo) */
.rg-pacco { max-width: 420px; margin: 10px auto 0; }
.rg-busta { position: relative; width: 320px; height: 210px; margin: 40px auto 0; perspective: 900px;
    animation: rg-galleggia 3.2s ease-in-out infinite; filter: drop-shadow(0 14px 22px rgba(0,0,0,.22)); }
.rg-busta-retro { position: absolute; inset: 0; background: var(--b-sfondo); border-radius: 10px; }
.rg-busta-lettera {
    position: absolute; left: 18px; right: 18px; top: 14px; height: 170px; border-radius: 6px;
    background: #fffdf7; border: 1px solid rgba(0,0,0,.06);
    display: flex; align-items: flex-start; justify-content: center; padding-top: 18px;
    font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: bold; color: var(--b-sfondo);
    transition: transform .9s cubic-bezier(.2,.8,.2,1) .45s; z-index: 1;
}
.rg-busta-fronte { /* fronte PIENO: il biglietto resta nascosto finché non esce dall'alto */
    position: absolute; inset: 0; border-radius: 10px; z-index: 2; overflow: hidden;
    background:
        linear-gradient(to bottom right, rgba(0,0,0,.10) 0 49.7%, transparent 50%) left top / 50% 100% no-repeat,
        linear-gradient(to bottom left, rgba(0,0,0,.10) 0 49.7%, transparent 50%) right top / 50% 100% no-repeat,
        var(--b-sfondo);
}
.rg-busta-fronte::before { /* piega inferiore, appena più chiara */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(rgba(255,255,255,.07), rgba(255,255,255,.07)), var(--b-sfondo);
    clip-path: polygon(0 100%, 50% 48%, 100% 100%);
}
.rg-busta-lembo {
    position: absolute; left: 0; right: 0; top: 0; height: 118px; z-index: 3;
    background: var(--b-sfondo); filter: brightness(.92);
    clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 10px 10px 0 0;
    transform-origin: top center; transition: transform .6s ease-in-out, z-index 0s .3s;
}
.rg-busta-fronte::after { /* filo dorato sui bordi */
    content: ""; position: absolute; inset: 7px; border: 1px solid var(--b-primario); border-radius: 6px; opacity: .55;
}
.rg-busta-sigillo {
    position: absolute; left: 50%; top: 96px; width: 52px; height: 52px; margin-left: -26px; z-index: 4;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px;
    background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--b-primario);
    box-shadow: 0 2px 6px rgba(0,0,0,.3), inset 0 0 0 3px rgba(0,0,0,.12);
    transition: opacity .3s, transform .3s;
}
.rg-pacco-testo { text-align: center; margin-top: 26px; }
.rg-pacco-per { font-family: Georgia, 'Times New Roman', serif; font-size: 1.6rem; color: #111827; }
.rg-pacco-da { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-size: 1.1rem; color: #4b5563; margin-top: 2px; }
.rg-pacco-tocca { margin-top: 14px; font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; color: #9ca3af; }
.rg-pacco:hover .rg-busta-sigillo { transform: scale(1.06); }
/* apertura: sigillo via, lembo che si alza, biglietto che esce */
.rg-pacco.aperto .rg-busta { animation: none; }
.rg-pacco.aperto .rg-busta-sigillo { opacity: 0; transform: scale(.6); }
.rg-pacco.aperto .rg-busta-lembo { transform: rotateX(180deg); z-index: 0; }
.rg-pacco.aperto .rg-busta-lettera { transform: translateY(-95px); }
.rg-pacco.aperto .rg-pacco-tocca { visibility: hidden; }
.rg-pacco.aperto .rg-pacco-scatola { animation: none; }
@keyframes rg-galleggia { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 400px) { .rg-busta { width: 280px; height: 190px; } .rg-busta-lettera { height: 160px; } }
@media (prefers-reduced-motion: reduce) { .rg-busta { animation: none; } }

/* giro 13: data di consegna per esteso */
.regalo-data-testo { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid #fed7aa; color: #7c2d12; font-size: .95rem; }

/* 26/11: un po' d'aria attorno al consenso e al bottone "Compila tutti" */
.regalo-consenso { margin: 22px 0 24px; }
.btn-compila-tutti { display: inline-block; margin: 14px 0 22px; }
