/*************************************
GENERALI
**************************************/
body {
  background-color: #fff;
  font-family: "Poppins", sans-serif !important;
  overflow-x: hidden;
  color: #333;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-primary);
}

h2 {
  font-weight: 600;
  margin-bottom: 1rem;
}

p.subtitle {
  color: #666;
  margin-bottom: 2rem;
}

.logo {
  width: 130px;
  margin-bottom: 1.5rem;
}

a,
a:hover,
a:focus,
a:visited {
  color: var(--color-primary);
}

.border-primary {
  border-color: var(--color-primary) !important;
}

.form-check-input:checked {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.form-check-input:focus {
  box-shadow: none !important;
}
.form-control {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.form-control:focus {
  border-color: #ced4da !important; /*colore di default di bootstrap*/
  box-shadow: none !important;
}

.cursor-not-allowed {
  cursor: not-allowed;
}
.cursor-pointer {
  cursor: pointer;
}

.text-primary {
  color: var(--color-primary) !important;
}
.bg-primary {
  background-color: var(--color-primary) !important;
}

.text-muted {
  color: #4d5258 !important;
}

/* Bottoni che sembrano link */
.btn-link-like {
  background: none;
  border: none;
  color: var(--color-primary);
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: inline;
}

.btn-link-like:hover,
.btn-link-like:focus {
  color: var(--color-primary);
  text-decoration: none;
}

/*************************************
INIZIO TOAST CUSTOM
**************************************/
.toast {
  position: fixed;
  top: 20px;
  right: 5px;
  z-index: 99999999999;
}

/*************************************
INIZIO ALERT CUSTOM
**************************************/
.alert {
  margin: 0;
  padding: 6px 16px;
  border: 0;
  font-size: 13px;
  border-radius: 6px;
}
.alert-full-msg {
  background-color: var(--bg-alert-full-msg);
  padding: 40px 20px;
  border-radius: var(--bs-border-radius);
  color: var(--color-alert-full-msg);
}

.alert-success-custom {
  background-color: var(--bg-alert-success);
  color: var(--color-alert-high-contrast-success);
}

.alert-error-custom {
  background-color: var(--bg-alert-error);
  color: var(--color-alert-high-contrast-error);
}

.alert-warning-custom {
  background-color: var(--bg-alert-warning);
  color: var(--color-alert-high-contrast-warning);
}

/*************************************
LOGIN
**************************************/
#loginForm .input-group-text {
  background-color: #fff;
  border-right: none;
  color: var(--btn-primary);
}

#loginForm .input-group .form-control {
  border-left: none;
  box-shadow: none !important;
}

#loginForm .input-group-text i {
  font-size: 1rem;
}

/* Arrotonda meglio gli angoli */
#loginForm .input-group-text {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

/*************************************
WIZARD
**************************************/
.wizard-step {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  text-align: center;
  transition: all 0.5s ease;
}

.wizard-step.active {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* viene sovrascritto nella funzione updateNavbarSettings */
#stage {
  padding-top: 70px;
}

/*************************************
BOTTONI
**************************************/

.btn-primary,
.btn-primary:active:focus,
.btn-primary:active,
.btn-primary:hover,
.btn-primary:focus {
  color: var(--btn-primary-color) !important;
  background-color: var(--btn-primary) !important;
  border-color: var(--btn-primary) !important;
  box-shadow: none !important;
}
.btn-outline-primary,
.btn-outline-primary:active:focus,
.btn-outline-primary:active,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--btn-primary) !important;
  border-color: var(--btn-primary) !important;
  background: var(--btn-primary-color) !important;
  box-shadow: none !important;
}

@media (max-width: 576px) {
  .btn-lg {
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
  }
}

.back-btn {
  background: none;
  border: none;
  color: var(--btn-primary);
  font-weight: 600;
  cursor: pointer;
}

.bottom-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 1rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center;
  gap: 1rem;
  height: 72px;
  align-items: center;
}

.btn:focus {
  box-shadow: none !important;
}

/*************************************
LOADER
**************************************/

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.5);
  }
  70% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.5);
  }
}
#stage-loader {
  position: absolute;
  width: 100%;
  height: calc(100% - 15vh);
  z-index: 12;
  top: 0%;
  left: 0%;
  display: none;
  align-items: center;
}
.stage-loader--active {
  display: flex !important;
}
.stage-loader--active img {
  animation: pulse 2s infinite;
}
#stage-loader img {
  width: 200px;
  margin: 0 auto;
}

/*************************************
SERVIZI
**************************************/
.service-card {
  transition: all 0.3s ease;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background-color: #eacfcf;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card img {
  width: 100%;
  height: 220px;
  object-fit: scale-down;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  background-color: #f7dfe2;
}

/* descrizione bilanciata */
.service-card p {
  flex-grow: 1;
  color: #555;
  font-size: 0.9rem;
}

/*************************************
DECORAZIONI
**************************************/

.decoration-item {
  cursor: pointer;
  background-color: #ffffff;
  transition: background-color 0.2s, transform 0.1s;
}
.decoration-item:hover {
  background-color: #f8f9fa;
  transform: scale(1.01);
}
.decoration-thumb {
  width: 70px;
  height: 70px;
  overflow: hidden;
}
.decoration-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.decoration-item.selected {
  border: 1px solid var(--color-primary) !important;
  background-color: var(--color-secondary);
}

#btnGoAheadToSlot.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/*************************************
CALENDARIO
**************************************/

#calendar {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

#calendar .calendar-grid > div {
  padding: 0.75rem 0.25rem !important;
  line-height: 1 !important;
  min-height: 32px !important;
  box-sizing: border-box !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

#calendar .calendar-grid > div:empty {
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.calendar-day {
  font-size: 0.9rem;
  cursor: pointer;
}

.day-selected {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  font-weight: bold;
}

/*************************************
SLOT ORARI
**************************************/

.slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.slot {
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid var(--btn-primary);
  color: var(--btn-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.slot.selected {
  background: var(--btn-primary);
  color: white;
}

.slot:hover {
  background: var(--btn-primary);
  color: white;
}

/*************************************
REGISTRAZIONE
**************************************/

.title-in-form {
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.password-toggle .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.password-toggle .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-color: var(--btn-primary);
  background-color: var(--btn-primary);
  color: var(--btn-primary-color);
}

.password-toggle .btn:focus {
  box-shadow: none;
}

/* Regola generale: tutte le label allineate a sinistra */
#registrationUserForm label.form-label,
#resetPwdForm label.form-label,
#recoverPwdForm label.form-label {
  display: block;
  width: 100%;
  text-align: left !important;
}

#registrationUserForm .d-flex.align-items-center.flex-wrap {
  flex-wrap: wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

#registrationUserForm .d-flex.align-items-center.flex-wrap label.form-label {
  max-width: 100%;
  flex: 1 1 100%;
  margin-bottom: 0.5rem;
}

/*************************************
NAVBAR
**************************************/
/* NAVBAR fissa e sempre visibile */
.navbar-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1040;
  background-color: #fff;
  height: 70px !important;
}
.navbar-fixed .img-logo {
  max-height: 65px !important;
}

/*************************************
SIDEBAR
**************************************/
/* Sidebar base */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  /* background: var(--color-secondary); */
  background: #ffffff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1055;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  background-color: var(--color-primary);
  color: #fff;
  padding: 0 15px;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

/* Bottone chiusura */
.sidebar-header .btn-close {
  filter: invert(1);
  opacity: 0.8;
  padding: 0.5rem;
  transition: opacity 0.2s;
}
.sidebar-header .btn-close:hover {
  opacity: 1;
}

.sidebar-footer {
  border-top: 1px solid var(--color-primary);
  background-color: var(--color-secondary);
}

/* Contenuto */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* Ogni voce del menu */
.sidebar-list li {
  list-style: none;
  border-bottom: 1px solid var(--color-primary);
}

/* Link */
.sidebar-link {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  color: #000000 !important;
  text-decoration: none;
  background-color: transparent;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, padding-left 0.2s;
}

/* Icona freccia (pseudo-elemento) */
.sidebar-link::after {
  content: url("data:image/svg+xml,%0A%3Csvg width='10px' height='16px' viewBox='0 0 10 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg id='Listview' transform='translate(-112.000000, -120.000000)' stroke='%239e3355' stroke-width='2.178'%3E%3Cpolyline id='Path' points='114 122 120 128 114 134'%3E%3C/polyline%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  font-size: 1.1rem;
  opacity: 0.7;
  transition: transform 0.2s, opacity 0.2s;
}

.sidebar-link-logout {
  width: 100%;
  display: flex;
  justify-content: start;
  align-items: center;
  padding: 12px 18px;
  color: var(--color-primary);
  text-decoration: none;
  background-color: transparent;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, padding-left 0.2s;
}

/* Hover */
.sidebar-link:hover,
.sidebar-link-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 22px;
}
.sidebar-link:hover::after,
.sidebar-link-logout:hover::after {
  transform: translateX(4px);
  opacity: 1;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1050;
}

/* Stato aperto */
.sidebar.show {
  transform: translateX(0);
}
.sidebar-overlay.show {
  display: block;
}

/* Responsive */
@media (max-width: 575px) {
  .sidebar {
    width: 80%;
  }
}

/*************************************
APPUNTAMENTI
**************************************/

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.app-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ffffff, #f9fafc);
  border: 1px solid #e6e9ef;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.app-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.app-row[data-status="active"] {
  border-left: 5px solid var(--color-primary);
}
.app-row[data-status="soon"] {
  border-left: 5px solid #ffc107;
}
.app-row[data-status="past"] {
  border-left: 5px solid #6c757d;
}
.app-row[data-status="cancelled"] {
  border-left: 5px solid #dc3545;
}

.app-main {
  flex: 1;
  text-align: left;
}

.app-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
}

.app-sub {
  font-size: 0.9rem;
  color: #777;
  margin-top: 2px;
}

.app-date {
  background: #f4f6f9;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #555;
  margin-top: 6px;
  font-weight: 500;
}
.app-date i {
  color: var(--color-primary);
}

/* ===== PAGINAZIONE APPOINTMENTS ===== */
.mini-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.mini-btn {
  border: 1px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mini-btn:hover:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
}

.mini-label {
  font-size: 0.95rem;
  color: #444;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 575px) {
  .mini-pagination {
    gap: 8px;
  }
  .mini-btn {
    padding: 5px 8px;
    font-size: 0.9rem;
  }
  .mini-label {
    font-size: 0.85rem;
  }
}

/*************************************
PROFILO
**************************************/

#editUserForm label.form-label {
  display: block;
  width: 100%;
  text-align: left !important;
}

#editUserForm .d-flex.align-items-center.flex-wrap {
  flex-wrap: wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

#editUserForm .d-flex.align-items-center.flex-wrap label.form-label {
  max-width: 100%;
  flex: 1 1 100%;
  margin-bottom: 0.5rem;
}

/* .profile-card {
  position: relative;
  perspective: 1400px;
  height: auto;
  transition: height 0.35s ease;
}
.profile-view,
.profile-edit {
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}
.profile-edit {
  transform: rotateY(-180deg);
}
.profile-card.edit-mode .profile-view {
  transform: rotateY(180deg);
}
.profile-card.edit-mode .profile-edit {
  transform: rotateY(0deg);
}

.profile-view,
.profile-edit {
  opacity: 0;
  pointer-events: none;
}

.profile-card:not(.edit-mode) .profile-view {
  opacity: 1;
  pointer-events: auto;
}

.profile-card.edit-mode .profile-edit {
  opacity: 1;
  pointer-events: auto;
}

.profile-inner {
  position: relative;
  padding-bottom: 1px;
} */

/* Contenitore */
.profile-card {
  position: relative;
}

/* Stati */
.profile-view,
.profile-edit {
  display: none; /* gestione principale */
  opacity: 0; /* per fade */
  transform: translateY(20px); /* per slide */
  transition: opacity 3s ease-in-out, transform 1s ease-in-out;
}

/* Mostra */
.profile-view.active,
.profile-edit.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Wrapper interno (serve per height pulita) */
.profile-inner {
  position: relative;
}

/*************************************
PROFILO – VIEW MODE
**************************************/
.profile-view .card {
  background-color: #fff;
  border-radius: 16px;
  border: 1px solid #f1f1f1;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.profile-view .card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem 2rem;
}

.profile-view .card-body .profile-field {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 16px;
  transition: background 0.2s;
}
.profile-view .card-body .profile-field:hover {
  background: #f1f3f4;
}

.profile-view .profile-label {
  letter-spacing: 0.5px;
  color: #000000;
  display: block;
  margin-bottom: 4px;
}
.profile-view .profile-value {
  font-weight: 600;
  color: #222222;
  word-break: break-word;
}

/* separatore visivo per gruppi */
.profile-section-title {
  grid-column: 1 / -1;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-primary);
  padding-bottom: 4px;
  margin-top: 8px;
}

@media (max-width: 576px) {
  .profile-view .card-body {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}
