/* Tuttigiorni - rinnovo consensi Fidelity Card
   Token visivi ricavati dai mockup DOCX (§3.2, §3.3) e dal PDF "Form rinnovo consensi Magento". */

:root {
    --bg: #f2f1ee;
    --card-bg: #ffffff;
    --text: #23241f;
    --text-muted: #6b6c66;
    --border: #e3e3e0;

    --info-bg: #eaf2fd;
    --info-text: #1f4e79;
    --info-border: #c9dcf5;

    --green: #0f7a43;
    --green-tint: #f2fbf6;

    /* CTA primaria. Contingenza: il brand puo' preferire il blu dei mockup DOCX,
       in tal caso e' sufficiente cambiare questo token. */
    --cta: #0f5132;
    --cta-hover: #0b3d26;

    --danger: #c0392b;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 24px 16px 48px;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.page { max-width: 640px; margin: 0 auto; }

/* ---------- Brand ---------- */

.brand { text-align: center; margin-bottom: 20px; }

.wordmark-dots { display: block; line-height: 0; margin-bottom: 6px; }

.wordmark-dots i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 2px;
    border-radius: 50%;
}

.wordmark-name {
    display: block;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #23241f;
}

.wordmark-claim {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ---------- Card ---------- */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 28px 26px;
}

h1 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.25;
    text-align: center;
}

h2 {
    margin: 26px 0 12px;
    font-size: 17px;
}

p { margin: 0 0 14px; }

/* ---------- Box informativo blu ---------- */

.info-box {
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 22px;
}

.info-box p:last-child { margin-bottom: 0; }

.info-box .info-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.deadline-box {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--info-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 14px;
}

/* ---------- Form ---------- */

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.field input,
.field select {
    width: 100%;
    padding: 11px 12px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid #cfcfca;
    border-radius: 8px;
}

.field input:focus,
.field select:focus {
    outline: 2px solid var(--info-text);
    outline-offset: 1px;
}

.field input[readonly] {
    background: #f4f4f1;
    color: var(--text-muted);
}

.field.has-error input,
.field.has-error select { border-color: var(--danger); }

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--danger);
}

.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-muted);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.grid .full { grid-column: 1 / -1; }

@media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .card { padding: 22px 18px; }
}

/* ---------- Consensi ---------- */

.consent {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: #fff;
}

.consent.required {
    border-color: var(--green);
    background: var(--green-tint);
}

.consent.has-error { border-color: var(--danger); }

.consent-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.consent-purpose {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge {
    flex: none;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #55564f;
    background: #ebebe7;
    border-radius: 999px;
    padding: 3px 10px;
}

.consent.required .badge {
    color: #ffffff;
    background: var(--green);
}

.consent-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.consent-row input[type="checkbox"] {
    flex: none;
    width: 19px;
    height: 19px;
    margin: 2px 0 0;
    accent-color: var(--green);
}

.consent-row label {
    font-size: 14.5px;
    cursor: pointer;
}

.consent a { color: var(--info-text); }

.consent-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 10px 0 0 29px;
    padding: 9px 12px;
    font-size: 13.5px;
    border: 1px dashed var(--green);
    border-radius: 10px;
    background: var(--green-tint);
}

.highlight { color: var(--danger); }

.section-hint {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: -6px 0 14px;
}

/* ---------- Bottoni ---------- */

.btn {
    display: inline-block;
    width: 100%;
    padding: 13px 18px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    background: var(--cta);
    border: 1px solid var(--cta);
    border-radius: 8px;
    cursor: pointer;
}

.btn:hover { background: var(--cta-hover); border-color: var(--cta-hover); }

.btn:disabled,
.btn.is-loading {
    cursor: progress;
    opacity: 0.85;
}

.btn.is-loading:hover {
    background: var(--cta);
    border-color: var(--cta);
}

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 9px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2.4s; }
}

.btn-secondary {
    color: var(--cta);
    background: #ffffff;
    border-color: #cfcfca;
}

.btn-secondary:hover { background: #f4f4f1; border-color: #b9b9b3; }

.form-actions { margin-top: 22px; }

/* ---------- Note / messaggi ---------- */

.hint {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.alert {
    padding: 11px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 14.5px;
    color: #7d2820;
    background: #fdecea;
    border: 1px solid #f5c6c0;
}

/* ---------- Esito ---------- */

.outcome { text-align: center; }

.outcome-icon {
    width: 72px;
    height: 72px;
    margin: 4px auto 16px;
    border-radius: 50%;
    background: var(--green-tint);
    border: 2px solid var(--green);
    color: var(--green);
    font-size: 38px;
    line-height: 68px;
}

.outcome-icon.neutral {
    background: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.outcome p { color: var(--text-muted); }

.outcome .btn { margin-top: 10px; }

/* ---------- Popup ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(20, 20, 18, 0.55);
    z-index: 50;
}

.modal-overlay.is-open { display: flex; }

.modal {
    max-width: 420px;
    width: 100%;
    background: #fff;
    border-radius: var(--radius);
    padding: 26px 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal h2 { margin: 0 0 12px; font-size: 19px; }

.modal p { font-size: 15px; }

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* ---------- Footer ---------- */

.page-footer {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}
