#menu-perfil {
  opacity: 0;
}

#menu-perfil[data-estado="aberto"] {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  #menu-perfil {
    transform: translateY(-4px);
    transition:
      opacity 180ms cubic-bezier(0.23, 1, 0.32, 1),
      transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
  }

  #menu-perfil[data-estado="aberto"] {
    transform: translateY(0);
  }
}

h1 {
  font-size: 1.25rem;
  line-height: 1.4rem;
  font-weight: 600;
  color: var(--color-step-primary);
}

h2 {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--color-step-text);
}

.main-step {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: 80rem;
  margin-inline: auto;
  gap: 1.5rem;
  padding-inline: 1rem;
  padding-bottom: 1rem;
}

.section-step {
  background-color: var(--color-step-offwhite);
  border-radius: 1rem;
  border: 1px solid var(--color-step-hover);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.select-step {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: var(--color-step-hover);
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.25rem;
  background-color: #ffffff;
  color: var(--color-step-text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;

  &:focus-visible {
    outline: none;
    border-color: var(--color-step-primary);
    box-shadow: 0 0 0 2px var(--color-step-primary-lighter);
  }

  &[aria-invalid="true"] {
    border-color: var(--color-step-error);

    &:focus-visible {
      box-shadow: 0 0 0 2px var(--color-step-error-lighter);
    }
  }
}

.step-field {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-card {
  border-radius: 1rem;
  background-color: #ffffff;
  border: 1px solid var(--color-step-hover);
  padding: 1rem;

  &.step-card-spaced {
    margin-top: 1rem;
  }
}

.step-card-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--color-step-text);
}

.step-form-group {
  margin-top: 0.75rem;
}

.step-label {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-step-muted);
  margin-bottom: 0.5rem;
  display: block;
}

.step-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.step-helper-text {
  font-size: 0.875rem;
  color: var(--color-step-muted);
  margin-top: 1rem;
}

.step-text-muted {
  color: var(--color-step-muted);
}

/* botões */
.botao-pequeno-secundario {
  background-color: var(--color-step-offwhite);
  color: var(--color-step-primary);
  border-radius: 0.5rem;
  padding-inline: 1rem;
  padding-block: 0.5rem;
  white-space: nowrap;
  align-self: flex-start;
  font-family: var(--font-inter);
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  border: 1px solid var(--color-step-primary);

  &:hover {
    background-color: var(--color-step-primary-lighter);
  }

  &:focus-visible {
    outline: 2px solid var(--color-step-primary);
    outline-offset: 2px;
  }
}

.botao-padrao-variavel {
  background-color: var(--color-step-primary);
  color: var(--color-step-offwhite);
  border-radius: 0.75rem;
  padding-inline: 2rem;
  padding-block: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.428rem;
  font-weight: 600;

  &:hover {
    background-color: var(--color-step-primary-dark);
  }

  &:focus-visible {
    outline: 2px solid var(--color-step-primary);
    outline-offset: 2px;
  }
}

.botao-cancelar-variavel {
  width: 100%;
  padding-inline: 1.5rem;
  padding-block: 0.625rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-step-error);
  color: var(--color-step-error);
  font-size: 0.875rem;
  line-height: 1.428rem;
  font-weight: 500;

  &:hover {
    background-color: var(--color-step-error-light);
  }

  &:focus-visible {
    outline: 2px solid var(--color-step-error);
    outline-offset: 2px;
  }
}

/* botões da rotina */
.btn-rotina {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  border-radius: 0.5rem;
  transition-property: color, background-color, border-color;
  transition-duration: 250ms;

  &:focus-visible {
    outline: 2px solid var(--color-step-primary);
    outline-offset: 2px;
  }

  &[data-state="nenhum"] {
    border: 1px solid var(--color-step-hover);
    color: var(--color-step-muted);

    &:hover {
      background-color: var(--color-step-primary-lighter);
      border-color: var(--color-step-primary);
      color: var(--color-step-primary);
    }
  }

  /* como os 3 tem o mesmo estilo css, pode ser colocado assim */
  &[data-state="ida"],
  &[data-state="volta"],
  &[data-state="ambos"] {
    background-color: var(--color-step-primary);
    color: white;

    &:hover {
      background-color: var(--color-step-primary-dark);
    }
  }

  &[data-state="desabilitado"] {
    background-color: var(--color-step-surface);
    color: var(--color-step-muted);
    cursor: not-allowed;
    border: 1px solid var(--color-step-hover);
    opacity: 60%;
  }
}

/* icones dos botões de rotina */
.icon-rotina {
  display: block;
  background-color: currentColor;

  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;

  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;

  width: 1rem;
  height: 1rem;
}

.btn-rotina[data-state="nenhum"] .icon-rotina {
  mask-image: url("../img/circle.svg");
  -webkit-mask-image: url("../img/circle.svg");

  opacity: 55%;
}

.btn-rotina[data-state="ida"] .icon-rotina {
  mask-image: url("../img/arrowright.svg");
  -webkit-mask-image: url("../img/arrowright.svg");
}

.btn-rotina[data-state="volta"] .icon-rotina {
  mask-image: url("../img/arrowleft.svg");
  -webkit-mask-image: url("../img/arrowleft.svg");
}

.btn-rotina[data-state="ambos"] .icon-rotina {
  mask-image: url("../img/comparearrows.svg");
  -webkit-mask-image: url("../img/comparearrows.svg");
}

.btn-rotina[data-state="desabilitado"] .icon-rotina {
  mask-image: url("../img/close.svg");
  -webkit-mask-image: url("../img/close.svg");
  opacity: 55%;
}

/* toast */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 24rem);

  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.15);
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s;
  pointer-events: auto;

  &.show {
    opacity: 1;
    transform: translateY(0);
  }

  &.hide {
    opacity: 0;
    transform: translateY(12px);
  }

  &.toast-success {
    --toast-progress-bg: var(--color-step-primary-light);
    background: var(--color-step-primary-lighter);
    color: var(--color-step-primary);
    border-color: var(--color-step-primary);
  }

  &.toast-error {
    --toast-progress-bg: var(--color-step-error-light);
    background: var(--color-step-error-lighter);
    color: var(--color-step-error);
    border-color: var(--color-step-error);
  }

  &.toast-warning {
    --toast-progress-bg: var(--color-step-warning-light);
    background: var(--color-step-warning-lighter);
    color: var(--color-step-warning);
    border-color: var(--color-step-warning);
  }

  &.toast-info {
    --toast-progress-bg: var(--color-step-info-light);
    background: var(--color-step-info-lighter);
    color: var(--color-step-info);
    border-color: var(--color-step-info);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: currentColor;
}

.toast-message {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.toast-close {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.8;
  transition: 0.2s;

  &:hover {
    opacity: 1;
  }
}

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--toast-progress-bg);
}

.toast-progress-bar {
  width: 100%;
  height: 100%;
  background: currentColor;
  transform-origin: left;
  animation: toast-progress var(--toast-duration) linear forwards;
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* media queries */
/* lg */
@media (width >= 64rem) {
  .main-step {
    flex-direction: row;
  }
}

/* md */
@media (width >= 48rem) {
  .main-step {
    padding: 2rem;
    padding-top: 0;
  }

  .section-step {
    padding: 1.5rem;
  }
}

/* sm */
@media (width >= 40rem) {
  .botao-pequeno-secundario {
    align-self: auto;
  }

  .botao-cancelar-variavel {
    width: auto;
  }

  .btn-rotina {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.step-card-label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--color-step-sub-text);
  line-height: 1.25;
  max-width: 180px;
}

.info-card {
  border: 1px solid var(--color-step-hover);
  border-radius: 0.5rem;
  padding: 1rem;
  padding-bottom: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.step-card-value {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--color-step-text);
  overflow-wrap: break-word;
  margin-top: 0.125rem;
}

.step-search-input {
  width: 100%;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  padding-left: 2.5rem;
  padding-right: 0.75rem;
  border: 1px solid var(--color-step-hover);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-step-text);
}

.step-search-input:focus {
  outline: none;
  border-color: var(--color-step-primary);
  box-shadow: 0 0 0 1px var(--color-step-primary);
}

.fl-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.small-label {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-step-text);
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.title-large {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: var(--color-step-text);
}

.timeline-line {
  position: absolute;
  left: 7px;
  top: 0.625rem;
  bottom: 0;
  width: 0.125rem;
  background-color: var(--color-step-primary-dark);
}

.flex-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.toggle-btn-s {
  width: 2.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  border-radius: 0.375rem;
  transition: all 200ms;
  color: var(--color-step-primary);
}

.toggle-btn-s:hover {
  background-color: #f9fafb;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.125rem;
  background-color: #ffffff;
  border: 2px solid var(--color-step-primary);
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  z-index: 10;
}

.s-badge {
  background-color: var(--color-step-primary-lighter);
  color: var(--color-step-primary);
  padding-left: 0.625rem;
  padding-right: 0.625rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1rem;
  white-space: nowrap;
}

.s-select {
  appearance: none;
  width: 100%;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  color: #111827;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  border-radius: 0.5rem;
  display: block;
  padding-left: 1rem;
  padding-right: 2.5rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
  height: 2.75rem;
  outline: none;
  cursor: pointer;
}

.s-select:focus {
  border-color: var(--color-step-primary);
  box-shadow: 0 0 0 1px var(--color-step-primary);
}

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  pointer-events: none;
}

.s-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background-color: #e5e7eb;
  object-fit: cover;
  flex-shrink: 0;
}

.s-form-label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.leaflet-routing-container {
  display: none;
}

.custom-stop-marker {
  background: transparent;
  border: none;
}

.stop-marker-atual,
.stop-marker-passada,
.stop-marker-futura {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.stop-marker-atual {
  background: #1174d1;
}

.stop-marker-passada {
  background: #28a15e;
}

.stop-marker-futura {
  background: #9ca3af;
}

/* Marcador do mapa */
.custom-stop-marker {
  background: transparent;
  border: none;
}

.stop-marker-agendada,
.stop-marker-atual,
.stop-marker-passada,
.stop-marker-futura {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

.stop-marker-agendada {
  background: #28a15e;
}

.stop-marker-atual {
  background: #1174d1;
}

.stop-marker-passada {
  background: #28a15e;
}

.stop-marker-futura {
  background: #9ca3af;
}

/* ============================================================
   LISTA DE PARADAS
   ============================================================ */

.stop-point-atual {
  background-color: #1174d1 !important;
  border-color: #1174d1 !important;
}

.stop-point-passada {
  background-color: #28a15e !important;
  border-color: #28a15e !important;
}

.stop-point-futura {
  background-color: #9ca3af !important;
  border-color: #9ca3af !important;
}

/* Linha entre as paradas */

.stop-line-atual {
  background-color: #1174d1 !important;
}

.stop-line-passada {
  background-color: #28a15e !important;
}

.stop-line-futura {
  background-color: #9ca3af !important;
}

/* Opcional: destaca um pouco a parada atual */

.stop-card-atual {
  font-weight: 600;
}
