/* ===================
   Contenitore principale
=================== */
#appointment-form {
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
  font-family: 'Helvetica Neue', sans-serif;
}

/* ===================
   Step e titoli
=================== */
.step {
  display: none;
}
.step.active {
  display: block;
}
.step-title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--button-color);
}

/* ===================
   Griglia di opzioni
=================== */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.option-block {
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.option-block:hover {
  border-color: var(--button-color);
}
.option-block.selected {
  background-color: var(--button-color);
  color: #fff;
  border-color: var(--button-color);
  font-weight: bold;
}
.home-links .option-block{
  background-color: var(--button-color);
  border-color: var(--button-color);
  color: #fff; 
  text-decoration: none !important;
}
.option-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
}
.slot-heading {
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-size: 1.1em;
}
/* ===================
   Textarea per note
=================== */
.step textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  resize: vertical;
  margin-bottom: 1.2rem;
  margin-bottom: 30px;
  margin-top: 10px;
}

/* ===================
   Progress bar
=================== */
#progress-container {
  width: 100%;
  height: 8px;
  background-color: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 2rem;
  overflow: hidden;
}
#progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--button-color);
  transition: width 0.3s ease;
}

/* ===================
   Toast di successo
=================== */
.toast {
  display: none;
  position: fixed;
  top: 30px;
  right: 30px;
  background-color: #4CAF50;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  font-weight: bold;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  max-height: 75px;
  width: 90%;
  left: 5%;
}
.toast.show {
  display: flex;
  align-items: center;
  opacity: 1;
  transform: translate(0, 50%);
}
@media (max-width: 500px) {
  .option-grid {
    grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
    padding: 30px 0;
  }
  #location-options.option-grid,#service-options.option-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }
}
/* Container generale */
#i-miei-appointment {
  padding: 1rem;
  font-family: sans-serif;
}
#appuntamento-form .platform-button.fullb{
  float:right;
}
#submitApp[disabled]{
  opacity: .7;
  cursor: not-allowed;
  pointer-events: none;
}
#appuntamento-form .platform-button.is-loading{
  position: relative;
  opacity: .85;
  pointer-events: none;
  padding-left: 50px;
}
#appuntamento-form .platform-button.is-loading::before{
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%) scale(0.97);
  background: url("loader-glasses.png") center/contain no-repeat;
  animation: umc-loader-pulse 1.05s ease-in-out infinite;
}
#submitApp.is-submitting{
  position: relative;
  padding-left: 50px;
}
#submitApp.is-submitting::before{
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%) scale(0.97);
  background: url("loader-glasses.png") center/contain no-repeat;
  animation: umc-loader-pulse 1.05s ease-in-out infinite;
}
@keyframes umc-loader-pulse{
  0% { opacity: .35; transform: translateY(-50%) scale(0.97); }
  50% { opacity: 1; transform: translateY(-50%) scale(1); }
  100% { opacity: .35; transform: translateY(-50%) scale(0.97); }
}
/* Sezioni */
.appointment-main{
  padding: 10px;
}
.appointment-section {
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  column-gap: 20px;
}

.appointment-section h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--button-color);
}

/* Card */
.appointment-card {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  transition: box-shadow 0.5s;
  border: 1px solid var(--light-grey);
  -webkit-box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.08); 
  box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.08); 
}
.app-header .app-left{
  background-color: var(--light-bg);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  border-radius: 5px;
}
.app-date{
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}
.appointment-title{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
/* Contenuto card */
.appointment-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.app-location{
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 500 !important;
}
.app-starttime, .app-location span{
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  gap: 6px
}
.app-location span{
  color: var(--light-color) !important;
  font-size: 13px !important;
}
.app-starttime svg, .app-location svg{
  width: 18px;
  height: 18px;
}
.app-time{
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-len{
  background-color: #ccc;
  padding: 5px;
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 5px;
  line-height: 1;
}
.app-header{
  display: grid;
  grid-template-columns: 1fr 2fr;
  column-gap: 15px;
}
.app-footer{
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--light-grey);
}
.app-footer a{
  padding: 7px 30px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  border: 2px solid;
  text-decoration: none;
  display: block;
  text-align: center;
}
.app-directions a{
  background-color: var(--button-color);
  border-color: var(--button-color);
  color: #fff;
}
.app-phone a{
  background-color: #fff;
  border-color: var(--button-color);
  color: var(--button-color);
}
.appointment-info span {
  font-size: 0.95rem;
  color: #333;
}

.appointment-info .etichetta {
  font-weight: bold;
  color: #444;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background-color: var(--button-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
}
.appointment-section.passed .appointment-card{
  opacity: .7;
}
.appointment-section.passed .app-header .app-left{
  background-color: var(--light-grey);
}
.appointment-section.passed .app-directions a{
  background-color: var(--light-grey);
  border-color: var(--light-grey);
  color: #333;
}
.appointment-section.passed .app-phone a{
  border-color: var(--light-grey);
  color: #333;
  display: none;
}
.user-home-section{
  padding: 10px;
}
.availability-message.error {
    color: #c00;
    margin-top: 8px;
    font-weight: 500;
    background-color: #ffe5e5;
    padding: 10px 12px;
    border: 1px solid #c00;
    border-radius: 4px;
    margin-bottom: 40px;
}

/* ===================
   UI Refresh Cliente
=================== */
#appuntamento-form,
#i-miei-appointment,
.user-home-section {
  --ui-black: #111111;
  --ui-black-2: #1f1f1f;
  --ui-white: #ffffff;
  --ui-muted: #f3f4f6;
  --ui-border: #e5e7eb;
}

#appuntamento-form {
  width: 100%;
  max-width: 1280px;
  background: linear-gradient(180deg, #fcfcfc 0%, #f7f7f8 100%);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

#appuntamento-form .platform-button {
  border-radius: 12px;
  border-width: 1px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 11px 22px;
  transition: all 0.2s ease;
}

#appuntamento-form .platform-button.fullb {
  background: var(--ui-black);
  border-color: var(--ui-black);
  color: var(--ui-white);
  float: none;
}

#appuntamento-form .platform-button.fullb:hover {
  background: var(--ui-black-2);
  border-color: var(--ui-black-2);
  transform: translateY(-1px);
}

#appuntamento-form .platform-button.outline {
  background: var(--ui-white);
  border-color: var(--ui-black);
  color: var(--ui-black);
}

#appuntamento-form .platform-button.outline:hover {
  background: #f6f6f6;
}

#appuntamento-form .step-title {
  color: var(--ui-black);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

#appuntamento-form .option-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

#appuntamento-form .option-block {
  border: 1px solid var(--ui-border);
  background: var(--ui-white);
  border-radius: 14px;
  min-height: 84px;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

#appuntamento-form .option-block:hover {
  border-color: var(--ui-black);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

#appuntamento-form .option-block.selected {
  background: var(--ui-black);
  border-color: var(--ui-black);
  color: var(--ui-white);
}

#appuntamento-form #progress-container {
  height: 10px;
  border-radius: 999px;
}

#appuntamento-form #progress-bar {
  background: linear-gradient(90deg, #111 0%, #2b2b2b 100%);
}

#appuntamento-form .step-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

#appuntamento-form .step > .platform-button {
  margin-top: 12px;
}

#appuntamento-form .step > .platform-button + .platform-button {
  margin-left: 10px;
}

#appuntamento-form .anchor-slot {
  background: var(--ui-white);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.user-home-section .home-links {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.user-home-section .home-links .option-block {
  background: var(--ui-black);
  border-color: var(--ui-black);
  border-radius: 14px;
  min-height: 140px;
  color: var(--ui-white);
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.2);
}

.user-home-section .home-links .option-block:hover {
  background: var(--ui-black-2);
  border-color: var(--ui-black-2);
}

.appointment-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

#i-miei-appointment,
.user-home-section {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.appointment-section {
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 18px;
}

.appointment-card {
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.appointment-card:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

.app-header .app-left {
  background: #f6f6f7;
}

.app-len {
  background: #1f1f1f;
  color: #fff;
}

.app-footer a {
  border-radius: 12px;
  border-width: 1px;
  font-weight: 700;
}

.app-directions a {
  background: #111;
  border-color: #111;
  color: #fff;
}

.app-phone a {
  background: #fff;
  border-color: #111;
  color: #111;
}

.app-calendar-links {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.app-calendar-links .app-calendar-add {
  background: #fff;
  border: 1px solid #111;
  color: #111;
}

.app-directions a:hover,
.app-phone a:hover {
  transform: translateY(-1px);
}

@media (min-width: 1100px) {
  #appuntamento-form {
    padding: 28px 30px;
  }
}

@media (max-width: 767px) {
  #appuntamento-form {
    max-width: 100%;
    border-radius: 14px;
    padding: 16px;
  }

  #appuntamento-form .option-grid {
    grid-template-columns: repeat(auto-fill, minmax(42%, 1fr));
  }

  /* Mobile: slot orari più compatti e 2 per riga quando possibile */
  #slot-options.option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #slot-options.option-grid .option-block {
    min-height: 56px;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 0.92rem;
  }

  #appuntamento-form .step-buttons {
    flex-direction: column;
  }

  #appuntamento-form .platform-button {
    width: 100%;
  }

  #appuntamento-form .step > .platform-button + .platform-button {
    margin-left: 0;
    margin-top: 10px;
  }

  .appointment-section {
    grid-template-columns: 1fr;
  }

  .app-footer {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .app-calendar-links {
    grid-template-columns: 1fr;
  }
}

/* ===================
   Toast Cliente Refresh
=================== */
#appuntamento-form .toast,
#i-miei-appointment .toast,
.appointment-main .toast {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 24px;
  bottom: 22px;
  left: auto;
  width: min(92vw, 460px);
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #2f2f2f;
  background: linear-gradient(135deg, #0e0e0e 0%, #1b1b1b 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  z-index: 99999;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

#appuntamento-form .toast.show,
#i-miei-appointment .toast.show,
.appointment-main .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===================
   Push Opt-in Card
=================== */
.push-optin-card {
  margin: 0 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.push-optin-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.push-optin-copy strong {
  color: #111;
  font-size: 0.98rem;
}

.push-optin-copy small {
  color: #4b5563;
  font-size: 0.85rem;
}

#umcliente-enable-push.push-enabled {
  background: #1f2937;
  border-color: #1f2937;
}

@media (max-width: 767px) {
  .push-optin-card {
    flex-direction: column;
    align-items: stretch;
  }
  #appuntamento-form .toast,
  #i-miei-appointment .toast,
  .appointment-main .toast {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 12px;
  }
}

/* ===================
   Centro Notifiche Cliente
=================== */
.umc-notifications-topbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 12px;
}

.umc-bell-button {
  position: relative;
  border: 1px solid var(--ui-border, #e5e7eb);
  background: #fff;
  color: #111;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.umc-bell-icon {
  font-size: 18px;
  line-height: 1;
}

.umc-bell-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.umc-menu-host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.umc-notifications-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 99996;
}

.umc-notifications-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.umc-notifications-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 92vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 99997;
  display: flex;
  flex-direction: column;
}

.umc-notifications-drawer.open {
  transform: translateX(0);
}

body.umc-drawer-open {
  overflow: hidden;
}

.umc-notifications-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.umc-notifications-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.umc-notifications-head h3 {
  margin: 0;
  font-size: 1rem;
}

.umc-mark-all {
  border: 1px solid #111;
  background: #111;
  color: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.umc-drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.umc-notifications-list {
  padding: 10px;
  flex: 1;
  overflow: auto;
}

.umc-notification-row {
  width: 100%;
  text-align: left;
  border: 1px solid #ececec;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 8px;
  cursor: pointer;
  display: grid;
  row-gap: 4px;
}

.umc-notification-row.is-unread {
  border-color: #111;
  background: #f9fafb;
}

.umc-notification-title {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.umc-notification-body {
  font-size: 13px;
  color: #374151;
}

.umc-notification-date {
  font-size: 11px;
  color: #6b7280;
}

.umc-notification-empty {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

.appointment-card.focused {
  border-color: #111;
  box-shadow: 0 0 0 2px #111 inset, 0 14px 28px rgba(0, 0, 0, 0.14);
}
