/* CalManager Static — widget prenotazione call
 * Stile allineato a comunitaenergeticarinnovabile.it
 * (Montserrat, accent #009fda, testo #1d1d1f, muted #6e6e73, pannelli #f5f5f7). */

.cm-widget,
.cm-widget * { box-sizing: border-box; }

.cm-widget {
    --cm-accent: #009fda;
    --cm-accent-dark: #007aa3;
    --cm-accent-soft: #e6f5fb;
    --cm-text: #1d1d1f;
    --cm-muted: #6e6e73;
    --cm-line: #e3e3e8;
    --cm-panel: #f5f5f7;
    --cm-white: #fff;
    --cm-dark: #1d1d1f;
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--cm-text);
    text-align: left;
    max-width: 840px;
    margin: 0 auto;
    line-height: 1.45;
}

.cm-widget .cm-loading {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--cm-muted);
    font-weight: 500;
}

/* ---- Layout ------------------------------------------------------------ */

.cm-widget .cm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 18px;
    background: var(--cm-panel);
    border-radius: 28px;
    padding: clamp(16px, 2.6vw, 24px);
}

@media (max-width: 640px) {
    .cm-widget .cm-grid { grid-template-columns: 1fr; border-radius: 22px; }
}

.cm-widget .cm-cal,
.cm-widget .cm-slots {
    background: var(--cm-white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 34px -28px rgba(20, 30, 60, .35);
    min-width: 0;
}

/* ---- Calendar ---------------------------------------------------------- */

.cm-widget .cm-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cm-widget .cm-cal-label {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -.01em;
    text-transform: capitalize;
}
.cm-widget .cm-nav {
    appearance: none;
    -webkit-appearance: none;
    background: var(--cm-panel);
    border: 0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    color: var(--cm-text);
    cursor: pointer;
    transition: background .2s, color .2s;
    font-family: inherit;
    padding: 0;
}
.cm-widget .cm-nav:hover:not(:disabled) { background: var(--cm-accent); color: #fff; }
.cm-widget .cm-nav:disabled { opacity: .3; cursor: not-allowed; }

.cm-widget .cm-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: .88rem;
}
.cm-widget .cm-dow {
    text-align: center;
    color: var(--cm-muted);
    font-weight: 500;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 6px 0 8px;
}
.cm-widget .cm-day {
    appearance: none;
    -webkit-appearance: none;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cm-text);
    font-family: inherit;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: background .15s, color .15s, transform .15s;
}
.cm-widget .cm-day.cm-empty { visibility: hidden; }
.cm-widget .cm-day.cm-disabled { color: #c7c7cc; cursor: not-allowed; font-weight: 400; }
.cm-widget .cm-day.cm-holiday { text-decoration: line-through; }
.cm-widget .cm-day:not(:disabled):not(.cm-empty) { background: var(--cm-accent-soft); color: var(--cm-accent-dark); font-weight: 600; }
.cm-widget .cm-day:not(:disabled):not(.cm-empty):hover { background: var(--cm-accent); color: #fff; transform: translateY(-1px); }
.cm-widget .cm-cal-grid .cm-day.cm-selected,
.cm-widget .cm-cal-grid .cm-day.cm-selected:hover { background: var(--cm-accent); color: #fff; font-weight: 700; box-shadow: 0 6px 16px -6px rgba(0, 159, 218, .7); }
.cm-widget .cm-day.cm-today:not(.cm-selected) { box-shadow: inset 0 0 0 1.5px var(--cm-accent); }

/* ---- Slots ------------------------------------------------------------- */

.cm-widget .cm-slots-title {
    margin: 0 0 12px;
    font-size: .98rem;
    font-weight: 600;
    letter-spacing: -.01em;
}
.cm-widget .cm-slot-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 2px;
}
.cm-widget .cm-slot {
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 8px;
    border: 1.5px solid var(--cm-line);
    border-radius: 12px;
    background: var(--cm-white);
    color: var(--cm-text);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.cm-widget .cm-slot:hover { border-color: var(--cm-accent); color: var(--cm-accent-dark); transform: translateY(-1px); }
.cm-widget .cm-slot.cm-selected,
.cm-widget .cm-slot.cm-selected:hover { background: var(--cm-accent); border-color: var(--cm-accent); color: #fff; }

.cm-widget .cm-empty-msg {
    color: var(--cm-muted);
    font-size: .95rem;
    padding: .5rem 0;
}
.cm-widget .cm-empty-msg.cm-empty-sub {
    padding-top: .25rem;
    font-weight: 600;
    color: var(--cm-text);
}

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

.cm-widget .cm-form {
    grid-column: 1 / -1;
    background: var(--cm-white);
    border-radius: 20px;
    padding: clamp(18px, 2.6vw, 24px);
    box-shadow: 0 12px 34px -28px rgba(20, 30, 60, .35);
}
.cm-widget .cm-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cm-line);
    font-size: .95rem;
}
.cm-widget .cm-summary-label { color: var(--cm-muted); }
.cm-widget .cm-summary strong { color: var(--cm-accent-dark); font-weight: 600; }

.cm-widget .cm-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
@media (max-width: 640px) {
    .cm-widget .cm-fields { grid-template-columns: 1fr; }
}
.cm-widget .cm-field-full { grid-column: 1 / -1; }

.cm-widget .cm-field label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--cm-muted);
    margin-bottom: 6px;
}
.cm-widget .cm-field input,
.cm-widget .cm-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--cm-line);
    border-radius: 12px;
    background: var(--cm-white);
    color: var(--cm-text);
    font: inherit;
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.cm-widget .cm-field input:focus,
.cm-widget .cm-field textarea:focus {
    outline: none;
    border-color: var(--cm-accent);
    box-shadow: 0 0 0 3px rgba(0, 159, 218, .15);
}
.cm-widget .cm-field textarea { resize: vertical; min-height: 84px; }

.cm-widget .cm-hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cm-widget .cm-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

.cm-widget .cm-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--cm-dark);
    color: #fff;
    border: 0;
    border-radius: 980px;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.cm-widget .cm-btn:hover:not(:disabled) { background: var(--cm-accent); transform: translateY(-1px); }
.cm-widget .cm-btn:disabled { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
    .cm-widget .cm-actions { justify-content: stretch; }
    .cm-widget .cm-btn { width: 100%; }
}

/* ---- Feedback ---------------------------------------------------------- */

.cm-widget .cm-error {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fdecec;
    color: #9b1c1c;
    font-size: .92rem;
    font-weight: 500;
}

.cm-widget .cm-success {
    background: var(--cm-panel);
    border-radius: 28px;
    padding: clamp(28px, 4vw, 44px) 24px;
    text-align: center;
}
.cm-widget .cm-success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--cm-accent);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cm-widget .cm-success h4 { margin: 0 0 6px; font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.cm-widget .cm-success-when { margin: 0; font-weight: 600; color: var(--cm-accent-dark); }
.cm-widget .cm-success-sub { margin: 10px 0 0; color: var(--cm-muted); font-size: .95rem; }

.cm-widget .cm-blocked {
    background: var(--cm-panel);
    border-radius: 28px;
    padding: 36px 24px;
    text-align: center;
}
.cm-widget .cm-blocked-icon { font-size: 2rem; margin-bottom: 8px; }
.cm-widget .cm-blocked h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }

/* ---- Wrapper usato nella sezione #cer-cta del sito ---------------------- */

.cer-booking { margin: 40px auto 0; max-width: 840px; }
.cer-booking__eyebrow {
    color: #1d1d1f;
    font-weight: 600;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    letter-spacing: -.02em;
    margin: 0 0 6px;
}
.cer-booking__sub {
    color: #6e6e73;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 auto 22px;
    max-width: 560px;
}
