/* Appuntamenti (re-lib) — drawer calendario + fasce + form.
   Standalone (enqueued da functions.php). Riusa il markup .drawer già stilizzato.
   Colori: le custom properties --re-appto-accent* sono definite in re-lib/sass/_appuntamenti.scss,
   derivate da $titleColor (palette del progetto) — qui NIENTE colori di palette cablati. */

.re-appto__intro { margin: 0 0 .7em; opacity: .8; }

/* --- calendario --- */
.re-appto__calendar { position: relative; min-height: 250px; margin: 0 0 .6em; }

/* attesa async: ingombro riservato + spinner (niente layout shift) */
.re-appto__loading { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; z-index: 1; }
.re-appto.is-loading .re-appto__loading { display: flex; }
.re-appto.is-loading .re-appto__cal-head,
.re-appto.is-loading .re-appto__weekdays,
.re-appto.is-loading .re-appto__grid { visibility: hidden; }
.re-appto__spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #0000001a; border-top-color: var(--re-appto-accent);
  animation: re-appto-spin .8s linear infinite;
}
@keyframes re-appto-spin { to { transform: rotate(360deg); } }
.re-appto__cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .3em;
}
.re-appto__month { font-weight: 600; text-transform: capitalize; }
.re-appto__nav {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #0000001f; background: #fff; cursor: pointer; color: inherit;
  width: 32px; height: 32px; border-radius: 50%; line-height: 1;
  user-select: none;
}
/* Chevron SVG via mask: centrato per costruzione (viewBox simmetrico) dal flex del cerchio. */
.re-appto__nav::before {
  content: ''; width: 10px; height: 10px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='16%205%208%2012%2016%2019'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpolyline%20points='16%205%208%2012%2016%2019'/%3E%3C/svg%3E") center / contain no-repeat;
}
.re-appto__next::before { transform: scaleX(-1); }
.re-appto__nav:hover { border-color: var(--re-appto-accent); }
.re-appto__nav.is-off { opacity: .3; cursor: default; pointer-events: none; }

.re-appto__weekdays,
.re-appto__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0 2px; } /* row-gap azzerato */
.re-appto__grid { min-height: 192px; } /* 6 righe (6*32): footprint stabile tra mesi */
.re-appto__wd {
  text-align: center; font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  opacity: .5; padding: 1px 0;
}
.re-appto__day {
  appearance: none; -webkit-appearance: none;
  height: 32px; border: 1px solid transparent; background: #0000000a;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: inherit;
  display: flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: none; outline: none;
  transition: background .15s, border-color .15s;
}
.re-appto__day:not(.is-disabled):hover { border-color: var(--re-appto-accent); }
.re-appto__day.is-disabled {
  background: transparent; border-color: transparent; box-shadow: none;
  color: #0000003b; cursor: default;
}
/* Date non accessibili: nessun hover/focus. Le non-festive non ricevono eventi puntatore
   (le festive li mantengono per il tooltip title, ma senza bordo/outline su hover/focus). */
.re-appto__day.is-disabled:not(.is-holiday) { pointer-events: none; }
.re-appto__day.is-disabled:hover,
.re-appto__day.is-disabled:focus,
.re-appto__day.is-disabled:focus-visible { border-color: transparent; outline: none; box-shadow: none; }
.re-appto__day.is-selected { background: var(--re-appto-accent); color: #fff; border-color: var(--re-appto-accent); }

/* Festivo nazionale: NON prenotabile (eredita is-disabled) — distinto SOLO da un bg neutro
   (niente puntino/asterisco: occupa spazio e non serve, niente rosso/allerta) + tooltip col nome. */
.re-appto__day.is-holiday {
  background: var(--re-appto-accent-14); /* tinta accent ~14% (derivata da $titleColor) */
  color: #0000006b;
}

/* --- fasce (chip) --- */
.re-appto__slots { margin: 0 0 .8em; min-height: 2.2em; }
.re-appto__slots-hint { margin: 0; opacity: .6; font-size: 14px; }
.re-appto__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.re-appto__chip {
  display: inline-flex; align-items: center; user-select: none;
  border: 1px solid #00000024; background: #fff; border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-size: 14px; color: inherit; line-height: 1.2;
}
.re-appto__chip:hover { border-color: var(--re-appto-accent); }
.re-appto__chip.is-selected { background: var(--re-appto-accent); color: #fff; border-color: var(--re-appto-accent); }

/* --- form --- */
/* Gli input ereditano lo stile globale a sottolineatura del tema (come il form di contatto):
   nessun override di border/padding/font qui. La spaziatura verticale sta sul wrapper
   .field-required (l'input ha margine 0 -> l'asterisco resta centrato anche nel grid .re-appto__row). */
.re-appto__form .field-required { margin-bottom: 8px; }
.re-appto__form textarea { min-height: 120px; resize: vertical; margin-bottom: 8px; }

/* email + telefono affiancati da desktop (breakpoint large del tema) */
.re-appto__row { display: grid; grid-template-columns: 1fr; gap: 0 10px; }
@media (min-width: 64em) { .re-appto__row { grid-template-columns: 1fr 1fr; } }

.re-appto__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.re-appto__msg-toggle {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; margin: 0 0 14px;
  color: var(--re-appto-accent); text-decoration: none; font-size: 13px; user-select: none;
}
.re-appto__msg-ico { font-size: 18px; line-height: 1; }
/* espansione textarea messaggio con transizione (toggle -> .msg-open sul drawer) */
.re-appto__msg-wrap { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .32s ease, opacity .28s ease; }
.re-appto.msg-open .re-appto__msg-wrap { max-height: 220px; opacity: 1; }
.re-appto__privacy { font-size: 11.5px; color: var(--re-appto-muted); margin: 10px 0 0; text-align: center; }
.re-appto__privacy a { color: inherit; text-decoration: underline; }
.re-appto__submit { width: 100%; }

.re-appto__feedback { margin-top: 10px; font-size: 14px; }
.re-appto__feedback.is-ok { color: #2e7d32; }
.re-appto__feedback.is-error { color: #c62828; }

/* --- stato di conferma (post-invio): sostituisce prenotazione + form --- */
.re-appto.is-done .re-appto__intro,
.re-appto.is-done #title_appuntamento,
.re-appto.is-done .re-appto__calendar,
.re-appto.is-done .re-appto__slots,
.re-appto.is-done .re-appto__form { display: none; }
/* centratura verticale: testata (fascia telefono + overline) in alto, pannello al centro */
.re-appto.is-done .drawer_content { display: flex; flex-direction: column; }
.re-appto__done { display: none; text-align: center; padding: 22px 8px; }
.re-appto.is-done .re-appto__done {
  display: flex; flex: 1 1 auto;
  flex-direction: column; align-items: center; justify-content: center;
}
/* badge circolare morbido attorno all'icona */
.re-appto__done-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 50%; margin-bottom: 6px;
  background: var(--re-appto-accent-10);  /* tinta accent ~10% (derivata da $titleColor) */
  font-size: 44px; line-height: 1;
  color: var(--re-appto-accent-soft);     /* tinta chiara dell'accent */
}
.re-appto__done-title { margin: .35em 0 .3em; }
.re-appto__done-msg { margin: 0 auto; max-width: 30em; opacity: .85; font-size: 15px; line-height: 1.5; }

/* --- CTA nel dock --- */
.re_sticky_actions__btn--appuntamento i { font-variation-settings: 'FILL' 0; }

/* --- reveal in ingresso: i blocchi del drawer compaiono in fade-up a cascata all'apertura --- */
.re-appto .drawer_content > * { opacity: 0; transform: translateY(16px); }
.re-appto.open .drawer_content > * {
  opacity: 1; transform: none;
  transition: opacity .5s var(--reveal-ease, ease), transform .5s var(--reveal-ease, ease);
}
.re-appto.open .drawer_content > *:nth-child(1) { transition-delay: .05s; }
.re-appto.open .drawer_content > *:nth-child(2) { transition-delay: .11s; }
.re-appto.open .drawer_content > *:nth-child(3) { transition-delay: .17s; }
.re-appto.open .drawer_content > *:nth-child(4) { transition-delay: .23s; }
.re-appto.open .drawer_content > *:nth-child(5) { transition-delay: .29s; }
/* La fascia telefono è chrome fisso in alto: niente reveal (resta visibile, non animata). */
.re-appto .drawer_content > .drawer_phone_bar,
.re-appto.open .drawer_content > .drawer_phone_bar { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .re-appto .drawer_content > * { opacity: 1; transform: none; }
}
