:root {
  --gf-auth-backdrop: rgba(15, 23, 42, 0.72);
  --gf-auth-panel-gap: 2.5rem;
}

.gf-auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1050;
}

.gf-auth-modal[aria-hidden='false'] {
  opacity: 1;
  visibility: visible;
}

.gf-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--gf-auth-backdrop);
  backdrop-filter: blur(2px);
}

.gf-auth-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: #ffffff;
  border-radius: var(--gf-card-radius);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  padding: clamp(1.75rem, 2.5vw + 1.25rem, 2.75rem);
  overflow: hidden;
}

.gf-auth-modal__close {
  position: absolute;
  top: 1.125rem;
  right: 1.125rem;
  background-color: rgba(var(--gf-color-primary-rgb), 0.12);
  border-color: transparent;
  color: var(--gf-color-neutral-700);
}

.gf-auth-modal__close:hover,
.gf-auth-modal__close:focus {
  background-color: rgba(var(--gf-color-primary-rgb), 0.2);
  color: var(--gf-color-primary);
}

.gf-auth-modal__panels {
  position: relative;
  display: grid;
}

.gf-auth-panel[hidden] {
  display: none !important;
}

.gf-auth-panel__header {
  margin-bottom: 1.75rem;
}

.gf-auth-panel__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.25vw + 1.1rem, 2rem);
  font-weight: 700;
  color: var(--gf-color-neutral-900);
}

.gf-auth-panel__subtitle {
  margin: 0.5rem 0 0;
  color: var(--gf-color-neutral-500);
  max-width: 28rem;
}

.gf-auth-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  background: none;
  color: var(--gf-color-primary);
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0;
}

.gf-auth-panel__back:hover,
.gf-auth-panel__back:focus {
  color: var(--gf-color-primary-hover);
}

.gf-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gf-auth-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gf-auth-form__field .invalid-feedback {
  margin-top: 0;
}

.gf-auth-form__checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.gf-auth-form__checkbox .form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.4rem;
}

.destination-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.destination-list--compact {
  gap: 0.5rem;
}

.destination-entry {
  position: relative;
}

.destination-entry__label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.destination-entry__label:hover {
  background-color: rgba(var(--gf-color-primary-rgb), 0.06);
}

.destination-entry__checkbox {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.45rem;
  border: 2px solid rgba(15, 23, 42, 0.15);
  background-color: #ffffff;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.destination-entry__checkbox::after {
  content: '';
  position: absolute;
  width: 0.4rem;
  height: 0.8rem;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(45deg);
  top: 0.1rem;
  left: 0.45rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.destination-entry__text {
  flex: 1 1 auto;
}

.destination-entry__input:focus-visible + .destination-entry__label {
  outline: 3px solid rgba(var(--gf-color-primary-rgb), 0.25);
  outline-offset: 2px;
}

.destination-entry__input:checked + .destination-entry__label {
  background-color: rgba(var(--gf-color-primary-rgb), 0.08);
  box-shadow: 0 0 0 0.25rem rgba(var(--gf-color-primary-rgb), 0.08);
}

.destination-entry__input:checked + .destination-entry__label .destination-entry__checkbox {
  background-color: var(--gf-color-primary);
  border-color: var(--gf-color-primary);
  color: #ffffff;
}

.destination-entry__input:checked + .destination-entry__label .destination-entry__checkbox::after {
  opacity: 1;
}

.destination-entry--compact .destination-entry__label {
  padding: 0.6rem 0.85rem;
  gap: 0.7rem;
  border-radius: 0.75rem;
}

.destination-entry--compact .destination-entry__checkbox {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.35rem;
}

.destination-entry--compact .destination-entry__checkbox::after {
  width: 0.3rem;
  height: 0.6rem;
  left: 0.36rem;
  top: 0.05rem;
  border-right-width: 2px;
  border-bottom-width: 2px;
}

.destination-entry--compact .destination-entry__text {
  font-size: 0.95rem;
}

.gf-auth-form__grid {
  display: grid;
  gap: 1.1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gf-auth-form__actions {
  display: flex;
  justify-content: flex-end;
}

.gf-auth-form__submit {
  display: grid;
  gap: 0.85rem;
}

.gf-auth-profile {
  border: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.gf-auth-step {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gf-auth-step__actions {
  display: flex;
  justify-content: flex-end;
}

.gf-auth-step__actions .btn {
  min-width: clamp(160px, 22vw, 220px);
}

.gf-auth-step__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: rgba(var(--gf-color-primary-rgb), 0.06);
  border-radius: calc(var(--gf-card-radius) - 0.25rem);
}

.gf-auth-step__summary-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gf-auth-step__summary-label {
  font-size: 0.9rem;
  color: var(--gf-color-neutral-600);
}

.gf-auth-step__summary-value {
  font-weight: 600;
  color: var(--gf-color-primary);
}

.gf-auth-step__change {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: none;
  color: var(--gf-color-primary);
  font-weight: 600;
  padding: 0.25rem 0;
}

.gf-auth-step__change:hover,
.gf-auth-step__change:focus {
  color: var(--gf-color-primary-hover);
}

.gf-auth-profile__legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gf-color-neutral-700);
  margin-bottom: 0.75rem;
}

.gf-auth-profile__options {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.gf-auth-profile__option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.1rem;
  gap: 0.6rem;
  border-radius: 1rem;
  border: 1.5px solid rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  font-weight: 600;
  color: var(--gf-color-neutral-700);
}

.gf-auth-profile__option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.gf-auth-profile__option[data-active='true'],
.gf-auth-profile__option:hover {
  border-color: var(--gf-color-primary);
  background-color: rgba(var(--gf-color-primary-rgb), 0.08);
  color: var(--gf-color-primary);
  box-shadow: 0 0 0 3px rgba(var(--gf-color-primary-rgb), 0.12);
}

.gf-auth-profile__label {
  pointer-events: none;
}

.gf-auth-modal__dialog:focus-visible,
.gf-auth-profile__option:focus-visible,
.gf-auth-modal__close:focus-visible,
.gf-auth-panel__back:focus-visible,
.gf-auth-step__change:focus-visible {
  outline: 2px solid var(--gf-color-primary);
  outline-offset: 3px;
}

body.gf-auth-modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .gf-auth-modal {
    padding: 1rem;
  }

  .gf-auth-modal__dialog {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .gf-auth-step__summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .gf-auth-step__actions {
    justify-content: stretch;
  }

  .gf-auth-step__actions .btn {
    width: 100%;
  }

  .gf-auth-form__grid {
    grid-template-columns: 1fr;
  }

  .gf-auth-profile__options {
    grid-template-columns: 1fr;
  }

  .gf-auth-modal__close {
    top: 0.75rem;
    right: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gf-auth-modal {
    transition: none;
  }
  .gf-auth-profile__option,
  .gf-auth-modal__close {
    transition: none;
  }
}

/* Error message styling */
.invalid-feedback {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: #dc3545;
  line-height: 1.4;
}

.invalid-feedback div {
  margin-bottom: 0.25rem;
}

.invalid-feedback div:last-child {
  margin-bottom: 0;
}

.is-invalid {
  border-color: #dc3545 !important;
}

.is-invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Remove a barra lateral dos alertas */
.alert,
.alert-danger,
.alert-success,
.alert-warning,
.alert-info {
  border-left: none !important;
  padding-left: 15px !important;
}

.alert-danger {
  margin-bottom: 1.25rem;
}

.alert-danger div {
  margin-bottom: 0.25rem;
}

.alert-danger div:last-child {
  margin-bottom: 0;
}
