.address-form-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 20px;
  background: var(--background);
  overflow-y: auto;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--idt-primary-color);

  .form-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;

    i {
      color: var(--idt-primary-color);
      font-size: 20px;
    }
  }

  .loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--idt-primary-color);
    font-size: 14px;
    font-weight: 500;

    i {
      animation: spin 1s linear infinite;
    }
  }
}

.address-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  flex: 1;

  .form-field {
    position: relative;
  }
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  background: var(--surface);
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px;
  padding: 20px;
  z-index: 10;
}

/* Botões */
.btn {
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  text-decoration: none;

  &:hover:not(:disabled) {
    transform: translateY(-2px);
  }

  &:active:not(:disabled) {
    transform: translateY(-1px);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
  }

  i {
    font-size: 0.875rem;
  }
}

.btn-primary {
  background: linear-gradient(135deg, #FFC82E 0%, #FFB300 100%);
  color: #000000;
  box-shadow: 0 2px 8px rgba(255, 200, 46, 0.3);

  &:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFD700 0%, #FFC82E 100%);
    box-shadow: 0 4px 16px rgba(255, 200, 46, 0.4);
  }

  &:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
  }
}

.btn-secondary {
  background: #6c757d;
  color: white;
  box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);

  &:hover:not(:disabled) {
    background: #5a6268;
    box-shadow: 0 4px 16px rgba(108, 117, 125, 0.4);
  }
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--divider);

  &:hover:not(:disabled) {
    background: var(--hover-bg);
    border-color: var(--idt-primary-color);
    color: var(--idt-primary-color);
  }
}

/* Loading overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(var(--surface-rgb), 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--surface);
  border-top: 4px solid var(--idt-primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
  .address-form-container {
    padding: 16px;
  }

  .form-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-actions {
    flex-direction: column;
    
    .btn {
      width: 100%;
      justify-content: center;
    }
  }

  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;

    .form-title {
      font-size: 20px;
    }
  }
}

/* Tema escuro */
:host-context(.dark-theme) {
  .address-form-container {
    background: var(--background);
  }

  .form-header {
    border-bottom-color: #FFC82E;

    .form-title {
      color: var(--text-primary);

      i {
        color: #FFC82E;
      }
    }

    .loading-indicator {
      color: #FFC82E;
    }
  }

  .btn-outline {
    &:hover:not(:disabled) {
      border-color: #FFC82E;
      color: #FFC82E;
    }
  }
}

/* Animações de entrada */
.address-form-container {
  animation: fadeInUp 0.3s ease-out;
}

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