/* Variabili Colori e Font */
:root {
  --bg-light: #f8f9fa;
  --secondary-color: #cf142b;
  --primary-color: #0056ae;
  --text-dark: #2c3e50;
  --text-muted: #6c757d;
}

body {
  font-family: 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  min-height: 100Vh;
  display: flex;
  flex-direction: column;
}

/* --- Header e Brand --- */
header {
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 1rem 0;
  margin-bottom: 2rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  /* border-bottom: 1px solid #eaeaea; */
  margin-bottom: 0.5rem;
}

/* Gestione Loghi Responsive */
.brand-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  justify-content: space-between;
}


.brand-text {
  text-align: center;
  flex-grow: 1;
}

.site-title {
  font-weight: 700;
  font-size: 1.8rem;
  color: #0056ae;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.sub-title {
  color: #0056ae;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo-img {
  height: 60px;
  width: auto;
  transition: transform 0.3s ease;
}
/* --- Navbar Bootstrap Customization --- */
.navbar-custom {
  background-color: #0056ae;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--card-bg) !important;
}

.navbar-custom .nav-link {
  color: #fff !important;
  font-weight: 500;
  margin: 0 0.5rem;
  transition: color 0.2s, background-color 0.2s;
  border-radius: 5px;
}

/* .navbar-custom .nav-link:hover, 
.navbar-custom {
  color: var(--secondary-color);
  background-color: #fff;
} */

.nav-link.active{
  color: var(--secondary-color);
  background-color: #013e89;
}

/* --- Main Container & Cards --- */
main {
  flex: 1;
  padding-bottom: 3rem;
}

.selection-container {
  text-align: center;
  padding: 3rem 0;
  animation: fadeIn 0.8s ease-in-out;
}

/* Card di selezione ruolo */
.role-card {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  height: 100%;
  border-top: 4px solid transparent;
}

.role-card.active-selection {
  border-color: var(--secondary-color);
  background-color: #fff5f6;
  /* Un leggero sfondo rosato per indicare l'attivo */
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(207, 20, 43, 0.2);
}

.role-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-top: 4px solid var(--secondary-color);
}

.role-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.role-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: #333;
}

.role-desc {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.5rem;
}

/* Form Wrapper */
.form-wrapper {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
  display: none;
  /* Nascosto inizialmente */
}

/* Progress Bar */
.progress-container {
  margin-bottom: 2rem;
}

.progress {
  height: 10px;
  border-radius: 5px;
  background-color: #e9ecef;
}

.progress-bar {
  background-color: var(--secondary-color);
  transition: width 0.4s ease;
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.step-indicator span.active {
  color: var(--primary-color);
  font-weight: bold;
}

/* Form Sections & Transitions */
.form-section {
  display: none;
  animation: fadeIn 0.5s;
}

.form-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h4 {
  color: var(--primary-color);
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

label {
  font-weight: 600;
  color: #444;
  /* margin-top: 1rem; */
}

.btn-container {
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
}

.btn-next {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 2rem;
  border-radius: 50px;
}

.btn-next:hover {
  background-color: #152b4f;
  color: #fff;
}

.btn-prev {
  background-color: #e2e6ea;
  color: #333;
  border: none;
  padding: 0.6rem 2rem;
  border-radius: 50px;
}

.btn-prev:hover {
  background-color: #dbe2e8;
}

/* Dynamic Lists Style */
.dynamic-item {
  background: #f9f9f9;
  border: 1px solid #eee;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  position: relative;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #dc3545;
  cursor: pointer;
}

/* --- Footer --- */
footer {
  background-color: #0056ae;
  color: #fff;
  padding: 2rem 0;
  margin-top: auto;
}

footer a {
  color: #ccc;
  text-decoration: none;
}

footer a:hover {
  color: #fff;
}

.card-bg.small {
  color: #aaa;
  font-size: 0.9rem;
}

/* --- Media Queries --- */
@media (max-width: 992px) {
  .site-title { font-size: 1.4rem; }
  .logo-img { height: 50px; }
  .step-indicator {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
  }
}

@media (max-width: 768px) {
  .brand-container {
      flex-direction: column;
      gap: 1rem;
  }
  
  .site-title { font-size: 1.5rem; }
  
  .header-top {
      border-bottom: none;
  }
  
  /* Su mobile il menu diventa standard bootstrap collapsed */
  .navbar-custom {
      padding: 0.5rem;
  }
  .step-indicator {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.6rem;
    color: var(--text-muted);
  }
}