body {
  background-color: #F3F4F9; /* m3.surfaceContainerLow */
  color: #1D1B20; /* m3.onSurface */
  -webkit-font-smoothing: antialiased;
}

/* Material Symbols Setup */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Smooth Step Transitions */
.step-section {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.step-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* M3 Progress Indicator */
.m3-progress-bar {
  width: 100%;
  height: 4px;
  background-color: #E0E2EC;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}
.m3-progress-value {
  height: 100%;
  background-color: #0B57D0;
  transition: width 0.5s cubic-bezier(0.2, 0, 0, 1);
}

/* M3 Outlined Text Field (Versión Compacta) */
.m3-input-group {
  position: relative;
  margin-bottom: 8px; /* Puedes reducir a 4px si quieres menos espacio entre inputs */
  width: 100%;
}

.m3-input {
  width: 100%;
  padding: 12px 16px; /* Reducido de 16px (arriba/abajo) para hacerlo más compacto */
  font-size: 14px; /* Reducido de 16px para armonizar con el nuevo tamaño */
  line-height: 20px;
  color: #1D1B20;
  background-color: transparent;
  border: 1px solid #79747E;
  border-radius: 4px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  appearance: none;
}

/* Adjust padding if icon exists */
.m3-input-group.has-icon .m3-input {
  padding-left: 44px; /* Ajustado por el nuevo tamaño */
}

.m3-input-label {
  position: absolute;
  left: 16px;
  top: 12px; /* Bajado de 16px a 12px para centrar con el nuevo padding */
  font-size: 14px;
  line-height: 20px;
  color: #49454F;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  background-color: #FEF7FF; /* Card background color to mask border */
  padding: 0 4px;
  margin-left: -4px;
  z-index: 10;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 75% !important;
}

.m3-input-group.has-icon .m3-input-label {
  left: 44px;
}

.m3-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #49454F;
  pointer-events: none;
  transition: color 0.2s;
  font-size: 20px; /* Iconos un poco más pequeños para el diseño compacto */
}

/* Focus and Filled States */
.m3-input:focus {
  border: 2px solid #0B57D0;
  padding: 11px 15px; /* Compensación exacta del borde más grueso (12-1=11, 16-1=15) */
}
.m3-input-group.has-icon .m3-input:focus {
  padding-left: 43px; /* Compensación para el icono */
}

/* 1. Control exacto de etiquetas flotantes */
.m3-input:focus ~ .m3-input-label,
input.m3-input:not(:placeholder-shown) ~ .m3-input-label,
select.m3-input:valid ~ .m3-input-label,
.m3-input.has-value ~ .m3-input-label {
  top: -8px; /* Un poco más abajo para que corte la línea exactamente por la mitad */
  font-size: 12px;
  line-height: 16px;
  left: 12px;
  color: #49454F;
}

.m3-input:focus ~ .m3-input-label {
  color: #0B57D0;
}
.m3-input:focus ~ .m3-input-icon {
  color: #1D1B20;
}

/* 2. Selects M3 limpios (Compactos) */
select.m3-input {
  color: #1D1B20 !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2349454F'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px; /* Flecha ligeramente más pequeña */
  padding: 12px 36px 12px 16px; /* Combinamos el padding compacto con el espacio de la flecha */
}

select.m3-input:focus {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230B57D0'%3e%3cpath d='M7 14l5-5 5 5z'/%3e%3c/svg%3e");
  padding: 11px 35px 11px 15px; /* Compensación del borde en focus */
}

/* M3 Buttons */
.m3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9999px; /* Pill */
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.1px;
  height: 40px;
  padding: 0 24px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  cursor: pointer;
  border: none;
}

.m3-btn-large {
  height: 48px;
  padding: 0 32px;
  font-size: 16px;
}

.m3-btn-filled {
  background-color: #0B57D0;
  color: #FFFFFF;
}
.m3-btn-filled:hover {
  background-color: #004CBF; /* Darker primary */
  box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30);
}

.m3-btn-tonal {
  background-color: #D3E3FD;
  color: #041E49;
}
.m3-btn-tonal:hover {
  background-color: #C2D8FC;
}

.m3-btn-text {
  background-color: transparent;
  color: #FFF;
  padding: 0 12px;
  border: 1px white solid;
}
.m3-btn-text:hover {
  background-color: rgb(250, 238, 0);
  color: black;
  border: 1px solid #faee00;
}

/* Disabled State */
.m3-btn:disabled {
  background-color: rgba(29, 27, 32, 0.12);
  color: rgba(29, 27, 32, 0.38);
  box-shadow: none;
  cursor: not-allowed;
}

/* M3 Cards */
.m3-card {
  background-color: #FEF7FF;
  border-radius: 24px;
  overflow: hidden;
  /*border: 1px solid rgba(0,0,0,0.05); /* Subtle border for crispness */
  padding: 15px;
  margin-bottom: 10px;
}

.m3-card-title {
  font-size: 22px;
  line-height: 28px;
  font-weight: 400;
  color: #1D1B20;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.m3-card-title .material-symbols-outlined {
  color: #0B57D0;
  font-size: 28px;
}

/* Checkbox M3 Style */
.m3-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
}
.m3-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #49454F;
  border-radius: 2px;
  margin-top: 2px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.m3-checkbox:checked {
  background-color: #0B57D0;
  border-color: #0B57D0;
}
.m3-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.m3-checkbox-label {
  font-size: 14px;
  line-height: 20px;
  color: #1D1B20;
}

/* File Upload Area */
.m3-file-dropzone {
  border: 2px dashed #CAC4D0;
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #FEF7FF;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.m3-file-dropzone:hover {
  border-color: #0B57D0;
  background-color: #F8FAFF;
}
.m3-file-dropzone input[type="file"] {
  display: none;
}
.m3-file-icon {
  font-size: 32px;
  color: #0B57D0;
  margin-bottom: 8px;
}