:root { --rosso: #B0213F; --rosa: #FCF1F2; --testo: #141414; --grigio: #4A4A4A; }
* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--testo); font-family: Manrope, sans-serif; }
h1, h2, h3, .motto, .occhiello, .percento, footer { font-family: 'Bodoni Moda', serif; font-weight: 400; }
p, h1, h2, h3 { margin: 0; }
.definizioni { position: absolute; }
.pagina { max-width: 480px; margin: 0 auto; }
svg use { fill: var(--rosso); }

.copertina { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 32px 20px 36px; text-align: center; }
.data { font-size: 11px; font-weight: 700; letter-spacing: 5px; color: var(--rosso); }
h1 { font-size: 62px; line-height: 1; animation: appare 1.2s ease both; }
h1 em { color: var(--rosso); }
.foto-cuore { position: relative; width: 100%; max-width: 360px; aspect-ratio: 100 / 95; animation: appare 1.2s ease .5s both; }
.foto-cuore img { position: absolute; left: 6%; top: 7%; width: 88%; height: 86%; object-fit: cover; object-position: 52% 52%; clip-path: url(#ritaglio); }
.foto-cuore svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.foto-cuore path { fill: none; stroke: var(--rosso); stroke-width: .8; stroke-dasharray: 1; animation: disegna 2.8s ease .6s both; }
.motto { font-style: italic; font-size: 28px; line-height: 1.35; animation: appare 1.2s ease 1.4s both; }
.conto { font-size: 13px; color: var(--grigio); }
.pioggia { position: absolute; inset: 0; pointer-events: none; }
.pioggia svg { position: absolute; bottom: -30px; opacity: 0; animation-name: sale; animation-timing-function: ease-in; animation-iteration-count: infinite; }
.battito { animation: batti 1.7s ease-in-out infinite; }

.riempi { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 28px 44px; background: var(--rosa); text-align: center; }
h2 { font-size: 36px; line-height: 1.15; }
.riempi > p { font-size: 15px; line-height: 1.7; color: var(--grigio); }
.contatore { width: 180px; height: 171px; overflow: visible; animation: batti 2.2s ease-in-out infinite; }
.contatore .sfondo { fill: #fff; }
.contatore rect { fill: var(--rosso); }
.contatore .bordo { fill: none; stroke: var(--rosso); stroke-width: 1.5; }
.riempi .percento { font-size: 30px; color: var(--rosso); }

.esperienze { display: flex; flex-direction: column; gap: 68px; padding: 44px 0 36px; }
.scheda { display: flex; flex-direction: column; }
.foto { display: block; width: 100%; height: 340px; object-fit: cover; }
.scheda:nth-of-type(even) .foto { height: 480px; object-position: 50% 60%; }
.sigillo { position: relative; align-self: center; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; background: #fff; }
.testo { display: flex; flex-direction: column; gap: 14px; padding: 8px 28px 0; text-align: center; }
.occhiello { font-style: italic; font-size: 18px; color: var(--rosso); }
.testo h3 { font-size: 36px; line-height: 1.1; }
.descrizione { font-size: 15px; line-height: 1.7; color: var(--grigio); }
.barra { height: 3px; background: #F3DDE1; }
.barra span { display: block; height: 3px; background: var(--rosso); }
.dati { display: flex; justify-content: space-between; font-size: 13px; color: var(--grigio); }
.bottone { display: flex; align-items: center; justify-content: center; min-height: 54px; border-radius: 27px; background: var(--rosso); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.bottone.chiaro { align-self: stretch; background: #fff; color: var(--rosso); }
.libera { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0 20px; padding: 40px 24px; border-radius: 28px; background: var(--rosso); color: #fff; text-align: center; }
.libera svg use { fill: #fff; }
.libera h3 { font-size: 34px; }
.libera p { font-size: 15px; line-height: 1.7; }
footer { padding: 20px 24px 48px; text-align: center; font-style: italic; font-size: 26px; line-height: 1.4; }

@keyframes batti { 0%, 20%, 40%, 100% { transform: scale(1); } 10% { transform: scale(1.18); } 30% { transform: scale(1.12); } }
.battito, .contatore { transform-origin: center; }
@keyframes disegna { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes appare { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sale { 0% { opacity: 0; transform: translateY(0) rotate(-12deg); } 15% { opacity: .55; } 100% { opacity: 0; transform: translateY(-620px) rotate(18deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* Tablet */
@media (min-width: 700px) {
    .pagina { max-width: none; }
    .copertina { padding: 56px 32px 64px; }
    h1 { font-size: 84px; }
    .foto-cuore { max-width: 480px; }
    .riempi { padding: 64px 32px 72px; }
    h2 { font-size: 46px; }
    .contatore { width: 220px; height: 209px; }
    .esperienze { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px 32px; max-width: 1180px; margin: 0 auto; padding: 72px 32px 48px; }
    .scheda .foto, .scheda:nth-of-type(even) .foto { height: 420px; border-radius: 24px; }
    .testo { flex: 1; padding: 8px 12px 0; }
    .testo .barra { margin-top: auto; }
    .libera { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 640px; margin: 0; padding: 56px 48px; }
    .libera .bottone { align-self: center; width: 100%; max-width: 360px; }
    footer { padding: 32px 24px 72px; font-size: 32px; }
}

/* Computer */
@media (min-width: 1000px) {
    .copertina { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr repeat(5, auto) 1fr; column-gap: 56px; justify-items: center; min-height: 100vh; padding: 40px max(48px, calc((100% - 1180px) / 2)); }
    .copertina > .data { grid-area: 2 / 1; }
    .copertina > h1 { grid-area: 3 / 1; font-size: clamp(84px, 8vw, 120px); }
    .copertina > .motto { grid-area: 4 / 1; font-size: 36px; }
    .copertina > .battito { grid-area: 5 / 1; }
    .copertina > .conto { grid-area: 6 / 1; font-size: 15px; }
    .copertina > .foto-cuore { grid-area: 1 / 2 / -1 / 3; align-self: center; max-width: min(600px, 88vh); }

    .esperienze { display: flex; flex-direction: column; gap: 112px; padding: 112px 48px 64px; }
    .scheda { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: 1fr auto auto 1fr; column-gap: 56px; }
    .scheda .foto, .scheda:nth-of-type(even) .foto { grid-area: 1 / 1 / -1 / 2; height: 560px; }
    .sigillo { grid-area: 2 / 2; justify-self: center; margin: 0; }
    .testo { grid-area: 3 / 2; gap: 20px; padding: 8px 0 0; }
    .testo .barra { margin-top: 0; }
    .testo h3 { font-size: 48px; }
    .descrizione { font-size: 17px; }
    .scheda:nth-of-type(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .scheda:nth-of-type(even) .foto { grid-column: 2; }
    .scheda:nth-of-type(even) .sigillo, .scheda:nth-of-type(even) .testo { grid-column: 1; }
    .libera { align-self: center; }
}

/* Regalo e carta d'imbarco */
body.rosa { background: var(--rosa); }
.foglio { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 520px; margin: 0 auto; padding: 24px 20px 48px; text-align: center; }
.foglio > svg { flex: none; }
.indietro { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; padding: 0 18px; border: 1px solid var(--testo); border-radius: 22px; color: var(--testo); font-size: 14px; font-weight: 600; text-decoration: none; }
.imbarco ~ .indietro { align-self: center; }
.completa { min-height: 54px; display: flex; align-items: center; justify-content: center; color: var(--rosso); font-weight: 700; }
.modulo, .imbarco { align-self: stretch; padding: 24px; border-radius: 24px; background: #fff; text-align: left; }
.modulo { display: flex; flex-direction: column; gap: 10px; }
.modulo label { margin-top: 8px; font-size: 13px; font-weight: 600; }
.modulo input, .modulo textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #8A8A8A; border-radius: 14px; font: 16px Manrope, sans-serif; }
.proposte { display: flex; gap: 10px; }
.proposte button { flex: 1; min-height: 56px; border: 2px solid var(--rosso); border-radius: 16px; background: #fff; color: var(--rosso); font: 700 17px Manrope, sans-serif; cursor: pointer; }
.proposte button[aria-pressed="true"] { background: var(--rosso); color: #fff; }
button.bottone { margin-top: 14px; border: 0; font-family: Manrope, sans-serif; cursor: pointer; }
a.bottone { align-self: stretch; }
.errorlist { margin: 0; padding: 0; list-style: none; color: var(--rosso); font-size: 13px; }
.nota { font-size: 13px; line-height: 1.5; color: var(--grigio); text-align: center; }
.imbarco { display: flex; flex-direction: column; gap: 16px; line-height: 1.8; font-size: 14px; animation: appare 1s ease .3s both; overflow-wrap: anywhere; }
.etichetta { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--rosso); }
.sposi { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: 'Bodoni Moda', serif; font-size: 26px; }
.dedica { padding-top: 16px; border-top: 2px dashed #E4BCC4; font-family: 'Bodoni Moda', serif; font-style: italic; font-size: 22px; line-height: 1.35; }
.ultimo { font-size: 16px; }

/* La cifra del cuore */
.modulo label[for="id_importo"] { margin-top: 18px; font-family: 'Bodoni Moda', serif; font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.4; text-align: center; color: var(--rosso); }
.modulo #id_importo { align-self: center; width: 220px; border: 0; border-bottom: 2px solid var(--rosso); border-radius: 0; font-family: 'Bodoni Moda', serif; font-size: 48px; text-align: center; color: var(--rosso); -moz-appearance: textfield; appearance: textfield; }
.modulo #id_importo::-webkit-outer-spin-button, .modulo #id_importo::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Campo attivo, senza bordo nero */
.modulo input:focus, .modulo input:focus-visible, .modulo textarea:focus, .modulo textarea:focus-visible { outline: none; }
.modulo input:not(#id_importo):focus, .modulo textarea:focus { border-color: var(--rosso); box-shadow: 0 0 0 3px #F3DDE1; }
.modulo #id_importo:focus { border-bottom-width: 3px; background: var(--rosa); }

/* Casella importo con angoli arrotondati */
.modulo #id_importo { border: 2px solid var(--rosso); border-radius: 16px; }
.modulo #id_importo:focus { border-bottom-width: 2px; }
